From: Andre Wobst <wobsta@us...>  20060217 16:10:04

Hi, On 17.02.06, Arnd Baecker wrote: > I think you will have to split the plotting into parts, e.g., > if you have Numeric or numpy or numarray installed, you could do > > ################################################# > from pyx import * > from math import pi > from Numeric import arange, cos > > npts = 100 > x = pi/2.0*arange(npts)/(npts1) > y = cos(x) > > g = graph.graphxy(width=8, height=3.25, xpos=0, ypos=8, x2=None, y2=None, > x=graph.axis.lin(min=0, max=5, title="$t [s]$"), > y=graph.axis.lin(min=0.3, max=1.3, title="$U(t) [V]$")) > for i in xrange(4): > g.plot(graph.data.list(zip(x+i*pi/2.0, y), x=1, y=2), > [graph.style.line()]) > > g.writePDFfile("discont") > ################################################## > > Of course you can construct x and y as lists, but then > adding i*pi/2.0 won't work. Hey, that's pretty cool! I have a variant of that in case you don't want the vertial lines (as it would be mathematically correct). You can always insert "invalid" datapoints (everything that'll raise an error in an axis convert method). Those invalid points will lead to noncontiuous curves. In this case the y axis would be best to use, since you don't need the math on it anymore and thus can make a list from it (to enable different data types). Just do the following x = pi/2.0*arange(npts)/(npts2) y = list(cos(x)) y[1] = None instead of the "x = ..." and "y = ..." lines above. André  by _ _ _ Dr. André Wobst / \ \ / ) wobsta@..., http://www.wobsta.de/ / _ \ \/\/ / PyX  High quality PostScript and PDF figures (_/ \_)_/\_/ with Python & TeX: visit http://pyx.sourceforge.net/ 