From: André Wobst <wobsta@us...>  20080429 05:11:21

Hi Tim, this is tricky: You need a rangestyle with an nonedefault 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("pyxtest") > > # 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("pyxtest") > > 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 > _______________________________________________ > PyXuser mailing list > PyXuser@... > https://lists.sourceforge.net/lists/listinfo/pyxuser >  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/ 