From 438ee5bf76468e8c68054cd4f9b45862b82be612 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Wobst?= Date: Thu, 12 May 2011 23:43:07 +0000 Subject: [PATCH] 3d bar example git-svn-id: https://pyx.svn.sourceforge.net/svnroot/pyx/trunk/pyx@3059 069f4177-920e-0410-937b-c2a4a81bcd90 --- examples/3dgraphs/INDEX | 1 + examples/3dgraphs/bar.py | 9 +++++++++ examples/3dgraphs/bar.txt | 3 +++ examples/3dgraphs/surface.py | 2 +- 4 files changed, 14 insertions(+), 1 deletion(-) create mode 100755 examples/3dgraphs/bar.py create mode 100644 examples/3dgraphs/bar.txt diff --git a/examples/3dgraphs/INDEX b/examples/3dgraphs/INDEX index 21086f56..d3eed32a 100644 --- a/examples/3dgraphs/INDEX +++ b/examples/3dgraphs/INDEX @@ -1,3 +1,4 @@ surface color grid +bar diff --git a/examples/3dgraphs/bar.py b/examples/3dgraphs/bar.py new file mode 100755 index 00000000..ae130da1 --- /dev/null +++ b/examples/3dgraphs/bar.py @@ -0,0 +1,9 @@ +#!/usr/bin/env python +from pyx import * + +g = graph.graphxyz(0, 0, size=5, x=graph.axis.bar(), y=graph.axis.bar(), z=None, z2=graph.axis.lin()) +g.plot(graph.data.data(graph.data.points([[1, 1, 1.4], [1, 2, 1.8], [2, 1, -0.5], [2, 2, 0.9]]), xname=1, yname=2, z2=3), + [graph.style.barpos(fromvalue=0, frompathattrs=None), graph.style.bar(barattrs=[style.linejoin.bevel])]) +g.doplot() +g.writeEPSfile("bar") +g.writePDFfile("bar") diff --git a/examples/3dgraphs/bar.txt b/examples/3dgraphs/bar.txt new file mode 100644 index 00000000..76ba137c --- /dev/null +++ b/examples/3dgraphs/bar.txt @@ -0,0 +1,3 @@ +Bar graphs in 3d + +The bar style can also be used in 3d graphs. diff --git a/examples/3dgraphs/surface.py b/examples/3dgraphs/surface.py index d8c6b5fd..4b105b2b 100755 --- a/examples/3dgraphs/surface.py +++ b/examples/3dgraphs/surface.py @@ -3,6 +3,6 @@ from pyx import * g = graph.graphxyz(size=4, x2=None, y2=None) g.plot(graph.data.file("surface.dat", x=1, y=2, z=3), [graph.style.surface()]) -g.dodata() +g.doplot() g.writeEPSfile("surface") g.writePDFfile("surface") -- 2.11.4.GIT