"Mika Orajärvi" <[EMAIL PROTECTED]> writes: > This code does seem to draw some kind of histogram but it would be > much more usefull to have at least the y-scale as logarithmic. But I > haven't found a way to make the scale logarithmic.
According to the docstring of hist you can give it a keyword argument of log=True to make the y axis logarithmic. However there is a slight bug in that zero-height histogram bars like you have in your example cause log(0) to be computed. Here's a quick fix: ------------------------------------------------------------------------ from pylab import * x=0.000925,0.000879,0.000926,0.00088,0.001016,0.000931,0.000927,0.00088,\ 0.000926,0.000926,0.000879,0.0009 n, bins = mlab.hist(x, 1000) width = 0.9 * (bins[1]-bins[0]) nz = nonzero(n) bar(bins[nz], n[nz], width=width, log=True) grid(True) show() ------------------------------------------------------------------------ If the devs agree that this is a bug in hist, I can fix it in svn. -- Jouni K. Seppänen http://www.iki.fi/jks ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier. Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users