From: Gergely Ungvary <gergely.ungvary@co...> - 2010-01-06 11:06:55
I'm looking for a solution to properly display histograms of data
that is neither logarithmic, nor linear. Due to the nature of my data, I
manually specify my bins (which are neither fixed width, nor
logarithmic) - what I'd like to have is for each of my bins to have
equal bar widths.
Basically the old 'deprecated' fixed bar widths would be exactly
what I need. Is there any possibility to mimic the old behavior using
the new API? If not, it would be nice if someone re-introduced the old
fixed-width functionality or some other solution since I guess I'm not
the only one plotting statistical data with manually specified bins. In
my case relative bar widths are an eye-sore (especially since my bins
have large orders of magnitude differences, but exactly some of the
smaller ones are of interest).
From: Jae-Joon Lee <lee.joon@gm...> - 2010-01-08 18:23:12
On Wed, Jan 6, 2010 at 5:50 AM, Gergely Ungvary
> I guess I'm not
> the only one plotting statistical data with manually specified bins.
Yes, and mpl works fine with manually specified bins.
On the other hand, I don't see why you want to change the widths of
the bar. As far as I can see, that is not the correct representation
of the data.
Anyhow, here is a little example that makes your bars in equal width.
I never used "fixed width" bar so I'm not sure if this is what you
aa = np.random.rand(100)
bins = np.array([0., 0.2, 0.3, 0.8, 1.])
p = hist(aa, bins)
rects = p
for r in rects: