Hi Tim,

this is tricky: You need a range-style with an none-default usename  
setting (i.e. it's not obvious, but we already thought about such a  
case). Here a small modified version of the graphstyles/errorbar  
example:

     from pyx import *

     g = graph.graphxy(width=8)
     g.plot(graph.data.file("errorbar.dat", x=1, y=2, error=2,  
derror=3),
            [graph.style.histogram(), graph.style.range(usenames={"y":  
"error"}), graph.style.errorbar()])
     g.writePDFfile("errorbar")

HTH,


André


Am 29.04.2008 um 00:58 schrieb Tim Head:

> Hi
>
> I would like to plot a histogram with errorbars. I tried the obvious
> way, by specifying dy values but that has unexpected results.
>
> A quick google didn't yield anything promising ;(
>
> The following script demonstrates my problem and my current work  
> around.
>
> import pyx
>
> d = [1,2,3,4,5,6,7,8,9,10]
>
> data = pyx.graph.data.values(x=d, y=d, dy=[2]*len(d), title="data")
>
> g = pyx.graph.graphxy(width=8, key=pyx.graph.key.key())
> g.plot(data, [pyx.graph.style.histogram()])
> g.writePDFfile("pyx-test")
>
> # work around
> data = pyx.graph.data.values(x=d, y=d, title="data")
> # empty title to suppres it appearing in the key
> errors = pyx.graph.data.values(x=d, y=d, dy=[2]*len(d), title="")
>
> g = pyx.graph.graphxy(width=8, key=pyx.graph.key.key())
> g.plot(data, [pyx.graph.style.histogram()])
> g.plot(errors, [pyx.graph.style.errorbar()])
> g.writePDFfile("pyx-test")
>
> All ideas welcome ;]]
>
> tim
>
> -- 
> http://tim.jottit.com/
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
> Don't miss this year's exciting event. There's still time to save  
> $100.
> Use priority code J8TL2D2.
> http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
> _______________________________________________
> PyX-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pyx-user
>

-- 
by  _ _      _    Dr. André Wobst, Amselweg 22, 85716 Unterschleißheim
    / \ \    / )   [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 the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user

Reply via email to