matplotlib is not plotting all data points in the bar graph

The default width of a bar is, according to https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.bar.html, 0.8 . As you use a time series x axis, this would become 0.8 seconds, which may be too small to display anything at times.

Try

ax2.bar(x,on_season, color = 'green', width=86400*0.8)
ax2.bar(x,off_season, color = 'red', width=86400*0.8)

The toy example uses a different, integer scale, thats why it works so nicely.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top