python - Matplotlib.pyplot.hist() very slow -
i'm plotting 10,000 items in array. of around 1,000 unique values.
the plotting has been running half hour now. made sure rest of code works.
is slow? first time plotting histograms pyplot.
to plot histograms using matplotlib need pass histtype='step'
argument pyplot.hist
. example:
plt.hist(np.random.exponential(size=1000000,bins=10000)) plt.show()
takes ~15 seconds draw , 5-10 seconds update when pan or zoom.
in contrast, plotting histtype='step'
:
plt.hist(np.random.exponential(size=1000000),bins=10000,histtype='step') plt.show()
plots , can panned , zoomed no delay.
Comments
Post a Comment