From c104a3a53590cb2860c6ff5cc3e89efc11f309f2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Wobst?= Date: Tue, 20 Jan 2004 07:37:38 +0000 Subject: [PATCH] two small new graph examples git-svn-id: https://pyx.svn.sourceforge.net/svnroot/pyx/trunk/pyx@1275 069f4177-920e-0410-937b-c2a4a81bcd90 --- examples/graphs/inset.py | 9 +++++++++ examples/graphs/link.py | 14 ++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 examples/graphs/inset.py create mode 100644 examples/graphs/link.py diff --git a/examples/graphs/inset.py b/examples/graphs/inset.py new file mode 100644 index 00000000..0861cac0 --- /dev/null +++ b/examples/graphs/inset.py @@ -0,0 +1,9 @@ +from pyx import * + +g = graph.graphxy(width=8, x=graph.linaxis(min=-2, max=2)) +g.plot(graph.function("y=exp(x)")) +g2 = g.insert(graph.graphxy(width=2.5, xpos=1, ypos=3, + x=graph.linaxis(min=0, max=3), + y=graph.linaxis(min=-2, max=2))) +g2.plot(graph.function("y=log(x)")) +g.writetofile("inset") diff --git a/examples/graphs/link.py b/examples/graphs/link.py new file mode 100644 index 00000000..c53ceffd --- /dev/null +++ b/examples/graphs/link.py @@ -0,0 +1,14 @@ +import math +from pyx import * + +c = canvas.canvas() + +g1 = c.insert(graph.graphxy(width=8, + x=graph.linaxis(min=0, max=1))) +g1.plot(graph.function("y=2*exp(-30*x)-exp(-3*x)")) + +g2 = c.insert(graph.graphxy(width=8, ypos=g1.height+0.5, + x=g1.axes["x"].createlinkaxis())) +g2.plot(graph.function("y=cos(20*x)*exp(-2*x)")) + +c.writetofile("link") -- 2.11.4.GIT