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 