Hi Wojciech,

On 21.07.07, Wojciech Jaskowski wrote:
> First of all, I have to say I find PyX a brilliant library.
> I have problems with histogram style. The following simple code:
> 
>   from pyx import *
>   d = graph.data.list([(1,  25),
>                        (2,  7),
>                        (3,  3),
>                        (4,  8),
>                        (5,  5)], x=1, y=2)

d2 = graph.data.data(d, ymax="y+1")

>   g = graph.graphxy(width=8)
>   g.plot(d, [graph.style.histogram()])

g.plot(d2, [graph.style.histogram()])

>   g.writeEPSfile("histogram")

Some quick remarks:

1. The histogram style adds a range style in front to check whether
the user has specified some ranges (as for error bars, i.e. dy, ymin,
etc.) instead of using the automatic histogram width calculation.
Hence we don't need to add a graph.style.range() instance (as we could
and would need to do it to do the same for adding some padding to the
symbol style for example).

2. There are quite some bugs in the range's adjustaxis code as I found
out right now. I'm sure many people will have seen these bugs (and may
have thought that an automatic adjustment just isn't supported --
which is wrong). You can always set the axes ranges manually, but this
is not intended to be necessary to include the full range of
errorbars.

3. In early versions of PyX (version 0.1 to 0.4.1) I had axis range
features like datavmin to add some padding to the axis range
automatically. I thought it would be a useful feature but even Jörg
needed to ask me for some explanation what all this stuff was useful
for. He finally convinced me to remove that feature completely, since
it was just too complicated in all it's parameters. (You basically
could set a padding range in graph coordinates.)

4. Nowadays (since 0.6 or so) you can have multiple (and maybe
unvisible) graph styles for a given set of data. By that you can add
some ranges to the values to include them in the graph area (when the
range axes adjustment works as expected, which is infortunately not
always the case in PyX 0.9 -- see note 1 above). Compared to my
earlier code (note 3 above) you now have to specify the ranges in
problem coordinates, which I find less suitable, but it does not need
any additial code and/or parameters to the axis range adjustment.

5. You could restore a behaviour as in note 3 above by a proper axis
parter. So the design is modular here as well (even thou I dislike it
compared to the code we have for the graph styles now -- it's just
older code and I want to improve the axis code at some later point).


André

-- 
by  _ _      _    Dr. André Wobst
   / \ \    / )   [EMAIL PROTECTED], http://www.wobsta.de/
  / _ \ \/\/ /    PyX - High quality PostScript and PDF figures
 (_/ \_)_/\_/     with Python & TeX: visit http://pyx.sourceforge.net/

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user

Reply via email to