8000 make histtype='step' default · Issue #7121 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
make histtype='step' default #7121
Closed as not planned
Closed as not planned
@tlatorre-uchicago

Description

@tlatorre-uchicago

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0