I am trying to draw part of a histogram using matplotlib.
Instead of drawing the entire histogram with a lot of outliers and big values, I want to focus on only a small part. The original histogram looks like this:
hist(data, bins=arange(data.min(), data.max(), 1000), normed=1, cumulative=False) plt.ylabel("PDF")

And after focusing it looks like this:
hist(data, bins=arange(0, 121, 1), normed=1, cumulative=False) plt.ylabel("PDF")

Note that the last bit is stretched and the worst of all ticks Y is scaled so that the sum is 1 (therefore, points from the current range are not taken into account at all)
I know that I can achieve what I want by drawing a histogram over the entire possible range, and then limiting the axis to the part that is interesting to me, but it spends a lot of time counting boxes that I will not use / anyway.
hist(btsd-40, bins=arange(btsd.min(), btsd.max(), 1), normed=1, cumulative=False) axis([0,120,0,0.0025])

Is there a quick and easy way to draw only a focused area, but still get the right Y scale?