Description
I'm using matplotlib version 1.5.1 on Scientific Linux 6 (RHEL clone). I am using the matplotlib provided in the anaconda install.
I would like to propose that histograms are drawn by default with histtype='step'
. I've been using matplotlib for a long time, and it is very common (at least in high energy physics) to plot histograms with a large number of bins, which using the default drawing behavior leads to very unresponsive plots. For example:
plt.hist(np.random.exponential(size=1000000),bins=10000)
plt.show()
produces a histogram which takes ~15 seconds to draw and takes somewhere between 5-10 seconds to redraw after panning or zooming. In contrast, plotting with histtype='step'
:
plt.hist(np.random.exponential(size=1000000),bins=10000,histtype='step')
plt.show()
plots almost instantaneously and can be panned and zoomed with no delay.
The step option also follows the least ink principle which Edward Tufte recommends in his book "The Visual Display of Quantitative Information".
At a minimum, maybe the step option could be included in the histogram_demo.py file. I'd be happy to do this if it's a welcome addition.