Hi,
On 29.04.08, Tim Head wrote:
> I had looked at the range style because it is mentioned in both
> histogram and errorbar but could not quite figure out how to use
> usenames, docs read like it should be a dictionary but if you look in
> the code you see def range(....., usenames=[], ...).
>
> Maybe we can add an example to the docs of errorbar saying: "if you
> want errorbars in a histogram you need to provide your errorbar delta
> under a different name. The following code will take care of this:
> $your_code" (better english needed)
>
> Out of academic interest, why does adding dy= to my data confuse the
> histogram style?
This brings me to a point which I wanted to bring up for quite
some time now... At the moment, it's rather hard to figure out
what "sharedata" the styles need and also what they create.
I think, it would be really useful to mention this either in the
docstrings or the reference manual.
Cheers,
Jörg

Jörg,
Am 29.04.2008 um 09:38 schrieb Joerg Lehmann:
> This brings me to a point which I wanted to bring up for quite
> some time now... At the moment, it's rather hard to figure out
> what "sharedata" the styles need and also what they create.
PyX itself needs to fetch this information too. Here is how:
from pyx import *
print graph.style.pos.providesdata
print graph.style.range.providesdata
print graph.style.histogram.needsdata
BTW: It seems that you do not need to specify the range style
explicitely to use a non-automatic histogram. This is different from
what I wrote in the answer to time a few minutes ago. I haven't
checked, but the histogram tries to get a range by itself ...
> I think, it would be really useful to mention this either in the
> docstrings or the reference manual.
Well, there is some documentation in
print graph.style._style.__doc__
Certainly all this could be improved, but at least it's not that we're
trying to hide something from our users ...
André
--
by _ _ _ Dr. André Wobst, Amselweg 22, 85716 Unterschleißheim
/ \ \ / ) wobsta@..., http://www.wobsta.de/
/ _ \ \/\/ / PyX - High quality PostScript and PDF figures
(_/ \_)_/\_/ with Python & TeX: visit http://pyx.sourceforge.net/

Hi Tim,
Am 29.04.2008 um 09:28 schrieb Tim Head:
> I had looked at the range style because it is mentioned in both
> histogram and errorbar but could not quite figure out how to use
> usenames, docs read like it should be a dictionary but if you look in
> the code you see def range(....., usenames=[], ...).
It's a dictionary here:
andre@...:~/python/pyx/pyx/graph$ egrep -n '__init__.*usename'
style.py
210: def __init__(self, usenames={}, epsilon=1e-10):
(This is the current svn head ... I don't know whether it was a list
before, but it would not make too much sense.)
> Maybe we can add an example to the docs of errorbar saying: "if you
> want errorbars in a histogram you need to provide your errorbar delta
> under a different name. The following code will take care of this:
> $your_code" (better english needed)
Maybe we could add it using a double bend sign in the graphstyles/
errorbar ...
> Out of academic interest, why does adding dy= to my data confuse the
> histogram style?
Because you then provide a range in one graph dimension and a value in
the othogonal graph dimension. The histogram style can than plot
histogramms without using the autohistogram feature (for equal spaced
values). Just skip the errorbar and insert the graph.style.range()
before the graph.style.histogram() in the graph styles list.
André
--
by _ _ _ Dr. André Wobst, Amselweg 22, 85716 Unterschleißheim
/ \ \ / ) wobsta@..., http://www.wobsta.de/
/ _ \ \/\/ / PyX - High quality PostScript and PDF figures
(_/ \_)_/\_/ with Python & TeX: visit http://pyx.sourceforge.net/