Hi all,
I want to illustrate some results by a histogram. However my data is
very asymmetric, in the sense that some histogram"peaks" are very big,
while others are rather small. The usual way I illustrate such data is
with a logarithmic yaxis, however with a histogram (instead of a normal
plot), I'm not getting any further...
Here a small test program:
from pyx import *
histo = [[1, 2353], [2, 80], [3, 18], [4, 14], [5, 12], [6, 12]]
g = graph.graphxy(width=8,
x=graph.axis.linear(min=0, max=12, title="rank"))
g.plot(graph.data.list(histo, x=1, y=2),
[graph.style.histogram(autohistogramaxisindex=0, steps=0)])
g.writePDFfile("minimal")
This works, however if I add a
y=graph.axis.log(min=1, max=8000, title="number")
to the initialization of the g, I'm getting a math range error (pyx
somehow wants to compute a log of 0). By inspecting the code of
pyx/graph/axis/axis.py on line 81 and changing the code to something
like:
if float(value) < 0.01:
return 0
else:
return (math.log(float(value))  math.log(data.min)) /
(math.log(data.max)  math.log(data.min))
I at least get no error, and the plot looks as well not too bad. I
however can not see, why we are computing a log of 0 here. Can somebody
give my some hints how to solve this problem elegantly?
One thing about the resulting histogram I find not too beautiful:
neighbouring bins with same height get merged (no separating line
between the two bins), can we prevent this?
I would as well welcome suggestions about other approaches how to
illustrate such data, e.g. splitgraphs (which suffered as well from log
of 0).
Thanks in advance for your help, I would really appreciate this. Could
you please CC me, as I'm not subscribed to the list.
Best regards,
Patrick
