Am Dienstag 10 Juni 2008 21:15 schrieb Dan Reinholz: > My question this time is what is the preferred method > to plot a piecewise function?
As Alan said you can plot the pieces separately. Another possibility is to
define your function as in python and then plot this function as below.
# ---------------------------------------------------------------
def f(x):
if x<0: return 1
else: return 1+x
g = graph.graphxy(width=8, x=graph.axis.linear(min=-2, max=2),
y=graph.axis.linear(min=-0, max=3))
g.plot(graph.data.function("y(x)=f(x)", context=locals()))
# ---------------------------------------------------------------
Ciao,
Stefan
pgpoZBJsmWshz.pgp
Description: PGP signature
------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://sourceforge.net/services/buy/index.php
_______________________________________________ PyX-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/pyx-user
