## [PyX-user] Inverting axes when plotting data with errorbars

 [PyX-user] Inverting axes when plotting data with errorbars From: Néstor Espinoza - 2013-12-11 02:50:16 Attachments: Message as HTML ```Hi everyone, I just detected some kind of problem when inverting axes while plotting data with errobars. If I try reversing the y-axis by either setting the reverse flag to 1 or by changing the minimum and maximum ranges, the error I get is the same: raise ValueError("inverse range") ValueError: inverse range Is there any way to fix this? Here is some code so you can reproduce the problem: from pylab import * from pyx import * x = arange(10) y = arange(10) yerr = ones(10) #### PLOT OPTIONS ###### unit.set(xscale = 1.5) legend_text_size = -1 min_x = 0.0#000. max_x = 10.0#0. min_y=None max_y=None xaxis = r'Xaxis' yaxis = r'Yaxis' legend_pos = 'tr' # Plot only phased with LS: c = canvas.canvas() g = c.insert(graph.graphxy(height=8,width=20, key=graph.key.key(pos=legend_pos,vinside=0,columns=2,textattrs=[text.size(legend_text_size)]),\ x = graph.axis.linear(min=min_x,max=max_x,title = xaxis),\ y = graph.axis.linear(min=max_y,max=min_y,reverse=1,title = yaxis))) g.plot(graph.data.values(x=x, y=y, dy=yerr, title='Data'),\ styles = [graph.style.symbol(graph.style.symbol.circle,size=0.2,\ symbolattrs=[deco.filled,deco.stroked([color.rgb.black]),color.rgb.red]), \ graph.style.errorbar()]) g.writePDFfile('theplot') -- Néstor Espinoza PhD Student in Astrophysics Instituto de Astrofísica Pontificia Universidad Catolica de Chile Phone (office): (+562) 3547052 Web: http://www.astro.puc.cl/~nespino ```

 [PyX-user] Inverting axes when plotting data with errorbars From: Néstor Espinoza - 2013-12-11 02:50:16 Attachments: Message as HTML ```Hi everyone, I just detected some kind of problem when inverting axes while plotting data with errobars. If I try reversing the y-axis by either setting the reverse flag to 1 or by changing the minimum and maximum ranges, the error I get is the same: raise ValueError("inverse range") ValueError: inverse range Is there any way to fix this? Here is some code so you can reproduce the problem: from pylab import * from pyx import * x = arange(10) y = arange(10) yerr = ones(10) #### PLOT OPTIONS ###### unit.set(xscale = 1.5) legend_text_size = -1 min_x = 0.0#000. max_x = 10.0#0. min_y=None max_y=None xaxis = r'Xaxis' yaxis = r'Yaxis' legend_pos = 'tr' # Plot only phased with LS: c = canvas.canvas() g = c.insert(graph.graphxy(height=8,width=20, key=graph.key.key(pos=legend_pos,vinside=0,columns=2,textattrs=[text.size(legend_text_size)]),\ x = graph.axis.linear(min=min_x,max=max_x,title = xaxis),\ y = graph.axis.linear(min=max_y,max=min_y,reverse=1,title = yaxis))) g.plot(graph.data.values(x=x, y=y, dy=yerr, title='Data'),\ styles = [graph.style.symbol(graph.style.symbol.circle,size=0.2,\ symbolattrs=[deco.filled,deco.stroked([color.rgb.black]),color.rgb.red]), \ graph.style.errorbar()]) g.writePDFfile('theplot') -- Néstor Espinoza PhD Student in Astrophysics Instituto de Astrofísica Pontificia Universidad Catolica de Chile Phone (office): (+562) 3547052 Web: http://www.astro.puc.cl/~nespino ```
 Re: [PyX-user] Inverting axes when plotting data with errorbars From: André Wobst - 2013-12-13 22:05:32 Attachments: smime.p7s ```Dear Néstor, sorry for this problem, I will remove this needless check from the graph style. You may just comment out the lines creating this exception, or, as a workaround, pass ymin and ymax that way, that after applying the axis conversion to have a "proper" order, i.e. setting ymin=y+yerr and ymay=y-yerr. (That way it works in the released version without modification.) Thank you for bringing up this issue. Best, André PS: It might also be possible to pass negative values for yerr. I haven't tried, but I goes it works on an unmodified PyX too. Am 11.12.2013 um 03:49 schrieb Néstor Espinoza : > Hi everyone, > > I just detected some kind of problem when inverting axes while plotting data with errobars. If I try reversing the y-axis by either setting the reverse flag to 1 or by changing the minimum and maximum ranges, the error I get is the same: > > raise ValueError("inverse range") > ValueError: inverse range > > Is there any way to fix this? Here is some code so you can reproduce the problem: > > from pylab import * > from pyx import * > > x = arange(10) > y = arange(10) > yerr = ones(10) > #### PLOT OPTIONS ###### > unit.set(xscale = 1.5) > legend_text_size = -1 > min_x = 0.0#000. > max_x = 10.0#0. > min_y=None > max_y=None > xaxis = r'Xaxis' > yaxis = r'Yaxis' > legend_pos = 'tr' > # Plot only phased with LS: > c = canvas.canvas() > g = c.insert(graph.graphxy(height=8,width=20, key=graph.key.key(pos=legend_pos,vinside=0,columns=2,textattrs=[text.size(legend_text_size)]),\ > x = graph.axis.linear(min=min_x,max=max_x,title = xaxis),\ > y = graph.axis.linear(min=max_y,max=min_y,reverse=1,title = yaxis))) > > g.plot(graph.data.values(x=x, y=y, dy=yerr, title='Data'),\ > styles = [graph.style.symbol(graph.style.symbol.circle,size=0.2,\ > symbolattrs=[deco.filled,deco.stroked([color.rgb.black]),color.rgb.red]), \ > graph.style.errorbar()]) > > g.writePDFfile('theplot') > > > -- > Néstor Espinoza > PhD Student in Astrophysics > Instituto de Astrofísica > Pontificia Universidad Catolica de Chile > Phone (office): (+562) 3547052 > Web: http://www.astro.puc.cl/~nespino > ------------------------------------------------------------------------------ > Rapidly troubleshoot problems before they affect your business. Most IT > organizations don't have a clear picture of how application performance > affects their revenue. With AppDynamics, you get 100% visibility into your > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! > http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk_______________________________________________ > PyX-user mailing list > PyX-user@... > https://lists.sourceforge.net/lists/listinfo/pyx-user -- 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/ ```

No, thanks