Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Rightclick on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: Andrea Riciputi <ariciputi@pi...>  20050127 08:17:28

Hi, I have a problem that I've not been able to address, hope you can help me. Suppose I want to plot a data series and I don't know what the yvalues will be, suppose also that I want to write any text on the plot after the data, let's say on the rightupper corner. I'll try something like this: xAxis = pyx.graph.axes.lin(min = x_min, max = x_max) yAxis = pyx.graph.axes.lin() h = pyx.graph.graphxy(width = 10, height = 10, x = xAxis, y = yAxis) h.plot(pyx.graph.data.list(dataSet, x = 1, y = 2)) Now I try to write the label, but (yAxis.min, yAxis.max) == (None, None), and I don't now how to find the coordinates of the upperright (or whatever) corner. Obviously I'm missing something, could you give me some hints? Thanks, Andrea. 
From: Joerg Lehmann <joergl@us...>  20050127 08:44:37

Hi Andrea, On 27.01.05, Andrea Riciputi wrote: > I have a problem that I've not been able to address, hope you can help > me. Suppose I want to plot a data series and I don't know what the > yvalues will be, suppose also that I want to write any text on the > plot after the data, let's say on the rightupper corner. I'll try > something like this: > > xAxis = pyx.graph.axes.lin(min = x_min, max = x_max) > yAxis = pyx.graph.axes.lin() > > h = pyx.graph.graphxy(width = 10, height = 10, x = xAxis, y = yAxis) > > h.plot(pyx.graph.data.list(dataSet, x = 1, y = 2)) > > Now I try to write the label, but (yAxis.min, yAxis.max) == (None, > None), and I don't now how to find the coordinates of the upperright > (or whatever) corner. Obviously I'm missing something, could you give > me some hints? Just call h.finish() at this point, which tells the graph that it should calculate its layout, draw the background, the axes, the data and the key. If you just want to have the axis layout but do not want to be drawn anything, use h.dolayout(). See http://pyx.sourceforge.net/manual/modulegraph.graph.html for more details. There you also find a description of the pos method which allows you to transform the min and max values into canvas coordinates. Jörg 
From: Andre Wobst <wobsta@us...>  20050127 08:59:31

Hi, On 27.01.05, Andrea Riciputi wrote: > I have a problem that I've not been able to address, hope you can help > me. Suppose I want to plot a data series and I don't know what the > yvalues will be, suppose also that I want to write any text on the > plot after the data, let's say on the rightupper corner. I'll try > something like this: > > xAxis = pyx.graph.axes.lin(min = x_min, max = x_max) > yAxis = pyx.graph.axes.lin() > > h = pyx.graph.graphxy(width = 10, height = 10, x = xAxis, y = yAxis) > > h.plot(pyx.graph.data.list(dataSet, x = 1, y = 2)) > > Now I try to write the label, but (yAxis.min, yAxis.max) == (None, > None), and I don't now how to find the coordinates of the upperright > (or whatever) corner. Obviously I'm missing something, could you give > me some hints? I do not fully understand, what (yAxis.min, yAxis.max) == (None, None) is supposed to do. But I think you just want an easy way to access positions in the graph. For that you can use the graphs pos() and vpos() methods. (Note, that the pos() method can be only be used after the dolayout() method was called when the axis ranges are adjusted automatically.) But to get the upper right corner, you can just use x, y = h.vpos(1, 1) ... I'm not quite sure whether I totally misunderstood your question, so please, ask again, when I was pointing towards something totally uninteresting to you ... André  by _ _ _ Dr. André Wobst / \ \ / ) wobsta@..., http://www.wobsta.de/ / _ \ \/\/ / PyX  High quality PostScript figures with Python & TeX (_/ \_)_/\_/ visit http://pyx.sourceforge.net/ 
From: Andrea Riciputi <ariciputi@pi...>  20050127 15:04:53

Thanks to both Andr=E9 and J=F6rg for their answers. > I do not fully understand, what (yAxis.min, yAxis.max) =3D=3D (None, = None) > is supposed to do. Sorry, it is a bad habit of mine. I meant to say that yAxis.min and=20 yAxis.max are both still equal to None after my h.plot call. But as you=20= and J=F6rg have pointed out this is can be easily fixed calling=20 h.dolayout() method. Nevertheless your suggestion to use h.vpos is clearly better in this=20 case and it works even without calling h.dolayout(). Thanks again, Andrea. 
Sign up for the SourceForge newsletter:
No, thanks