Skip to content
Advertisement

Seaborn histogram makes columns white

In what cases Seaborn makes histogram columns white? I use it Seaborn in Jupyter notebook:

JavaScript

Then I plot histogram using this function:

JavaScript

As a result in some cases I have histograms with all blue columns or some blue and some white or only white columns. Please, see attached pictures.

How to make Seaborn always draw blue columns?

blue columns

blue and white

white

Advertisement

Answer

I believe the issue is that the edgecolor for the histogram is white, and as you increase the number of bins or decrease the width of the bars the edgecolor begins to cover the facecolor. You should be able to fix it by using a higher dpi,

JavaScript

a thinner linewidth,

JavaScript

or remove the outline altogether,

JavaScript

Note that the global methods may need to be after sns.set() as this may override them.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement