• Jobs
  • About Us
  • Jobs
    • Home
    • Jobs
    • Courses and challenges
  • Businesses
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

277
Views
Python Matplotlib Histogram Color

I hope you are well.

I am plotting a histogram using Matplotlib. I would like the color of the histogram to be "sky blue". But the data overlaps, and produces a histogram which is nearly black in color.

Thanks for helping

plt.hist(data, color = "skyblue")

Below is how the histogram looks. As you can see, though I've specified the color as "Skyblue, the histogram on the right is nearly black enter image description here

over 3 years ago · Santiago Trujillo
1 answers
Answer question

0

The reason for the histogram to look black is that the bars' surrounding lines (which are black) take most of the space.

Options would be to get rid of the edges by setting the linewidth to zero:

plt.hist(data, color = "skyblue", lw=0)

and/or to set the edgecolor to the same color as the bars itself

plt.hist(data, color = "skyblue", ec="skyblue")
over 3 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Show me some job opportunities
There's an error!