Hi Mika, 
Hi everybody,

I'm not sure I really understand your problem, but I attached my proposal / 
solution, so you can think about it or maybe describe your problem once more.

Much success,

Matthias Michler

>--------------------------------------------------------------------------------------------------
from pylab import figure, subplot, grid, close, show,\
                  hist, plot, semilogy, nonzero

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
figure(0)                                 # make histogram in figure 0
n, bins, patches = hist(x, 1000, align='center')
close(0)                                 # close figure to delete plot
                                              #  instance of hist
index = nonzero(n)                # to solve problems mit zero
                                              # values in log scale
figure(1)
ax = subplot(111)
ax.set_yscale('log')
l1 = plot(bins[index], n[index], ls='',marker ='x', ms=15, mew=3, c='r')
grid(True)
figure(2)
l2 = semilogy(bins[index], n[index], ls='',marker ='x', ms=15, mew=3, c='r')
grid(True)
show()
>---------------------------------------------------------------------------------------------------

On Tuesday 06 February 2007 15:33, Mika Orajärvi wrote:
> Hi!
> I'm trying to generate some kind of "distribution" view / histogram
> of decimal numbers, i.e. i want the graph to indicate exactly how many
> times any given decimal number occurs in "x". As an example, i've set the
> values to tuple "x" as seen in the code snipplet below. In reality there
> will be at least couple of thousand decimal values or more in the tuple (x
> in this example) and values will be retrieved from file etc. 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. I've tried to use semilogy/semilogx/loglog but with
> no success.
>
> ---------------
> 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, patches = hist(x, 1000)
> l = plot(bins, n, 'r--')
> grid(True)
> show()
> ----------------
>
> regards, Mika

-------------------------------------------------------------------------
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

Reply via email to