From: Markus Meyer <meyer@me...>  20060217 14:37:32

Hi everyone, I'm trying to draw graphs with discontinuities in it, like this: from pyx import * from math import cos, pi def f(x): return cos(x % (pi/2)) 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]$")) g.plot(graph.data.function("y(x)=f(x)", context=locals()), [graph.style.line()]) g.writePDFfile("discont") However, there are two problems with this: 1. The vertical slopes between the single instances of the sawtooths are not perfectly vertical. In cases, where I want to explicitely visualize that a function has discontinuities, this is something that will probably make the reader stumble. 2. In most books, the vertical slopes are not displayed at all. I cannot currently do this with graph.data.function. When using a graph.data.paramfunction, it looks a bit better, but when zooming in, one can still see, that the slopes are not perfectly vertical. I know that I can use graph.data.list to exactly control the points that are output, but I guess there should be a better way? Markus 