From 684fa52266188af749cf11c90e9b2633475769e1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Wobst?= Date: Tue, 19 Oct 2004 13:48:14 +0000 Subject: [PATCH] - adjustments to the new graph data+style handling git-svn-id: https://pyx.svn.sourceforge.net/svnroot/pyx/trunk/pyx@1885 069f4177-920e-0410-937b-c2a4a81bcd90 --- test/functional/test_bargraph.py | 18 ++++++++---------- test/functional/test_graph.py | 4 ++-- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/test/functional/test_bargraph.py b/test/functional/test_bargraph.py index a00c62b7..aeb63c04 100755 --- a/test/functional/test_bargraph.py +++ b/test/functional/test_bargraph.py @@ -5,8 +5,6 @@ import math from pyx import * from pyx import mathtree, attr -text.set(mode="latex") - def test_bar(c, x, y): g = c.insert(graph.graphxy(x, y, height=5, width=5, x=graph.axis.bar(title="Month", painter=graph.axis.painter.bar(nameattrs=[text.halign.right, trafo.rotate(90)])))) g.plot(graph.data.file("data/testdata2", xname=1, y=2, text=2), [graph.style.barpos(fromvalue=0), graph.style.bar(), graph.style.text()]) @@ -16,21 +14,21 @@ def test_bar2(c, x, y): g.plot(graph.data.file("data/testdata2", x=2, dx="1", yname=1), [graph.style.bar(), graph.style.errorbar()]) def test_bar3(c, x, y): - g = c.insert(graph.graphxy(x, y, height=5, width=12, x=graph.axis.bar(multisubaxis=graph.axis.bar(dist=0), painter=graph.axis.painter.bar(innerticklength=0.2)))) + g = c.insert(graph.graphxy(x, y, height=5, width=12, x=graph.axis.bar(multisubaxis=graph.axis.bar(dist=0), painter=graph.axis.painter.bar(innerticklength=0.2)), key=graph.key.key())) g.plot([graph.data.file("data/testdata2", xname=1, y=2), graph.data.file("data/testdata2", xname=1, y=3), - graph.data.file("data/testdata2", xname=1, y=3)], [graph.style.bar()]) + graph.data.file("data/testdata2", xname=1, y=3, title=None)], [graph.style.bar()]) def test_bar4(c, x, y): g = c.insert(graph.graphxy(x, y, height=5, width=12, x=graph.axis.bar(graph.axis.bar(dist=0)), key=graph.key.key())) - g.plot([graph.data.file("data/testdata2", xname=0, y=2, ystack1=3), - graph.data.file("data/testdata2", xname=0, y="$2-1", ystack1=3, title="test")], - [graph.style.bar(), graph.style.stackedbarpos("ystack1"), graph.style.bar([color.palette.ReverseRainbow]), graph.style.symbol()]) + g.plot([graph.data.file("data/testdata2", xname=0, y=2, ystack1=3, title="test"), + graph.data.file("data/testdata2", xname=0, y="$2-1", ystack1=3)], + [graph.style.bar(), graph.style.stackedbarpos("ystack1"), graph.style.bar([color.palette.ReverseRainbow])]) c = canvas.canvas() -test_bar(c, 0, 0) -test_bar2(c, 7, 0) -test_bar3(c, 0, -7) +#test_bar(c, 0, 0) +#test_bar2(c, 7, 0) +#test_bar3(c, 0, -7) test_bar4(c, 0, -14) c.writeEPSfile("test_bargraph", paperformat="a4") diff --git a/test/functional/test_graph.py b/test/functional/test_graph.py index 4853d78a..c048eb2b 100755 --- a/test/functional/test_graph.py +++ b/test/functional/test_graph.py @@ -36,7 +36,7 @@ def test_textaxis_errorbars(c, x, y): g = c.insert(graph.graphxy(x, y, height=5, x=graph.axis.lin(min=0.5, max=12.5, parter=graph.axis.parter.lin("1", extendtick=None)), y=graph.axis.lin(min=-10, max=30, title="Temperature [$^\circ$C]"), - x2=graph.axis.lin(), y2=graph.axis.lin())) + x2=graph.axis.lin(painter=graph.axis.painter.regular(labelattrs=None)), y2=graph.axis.lin())) g.plot(graph.data.file("data/testdata2", x=0, ymin="min", ymax="max"), [graph.style.errorbar()]) a = graph.style.symbol.triangle g.plot(graph.data.paramfunction("k", 0, 2*math.pi, "x2, y2, dx2, dy2 = 0.8*sin(k), 0.8*cos(3*k), 0.05, 0.05"), [graph.style.symbol(symbol=a), graph.style.errorbar()]) @@ -63,7 +63,7 @@ def test_ownmark(c, x, y): (seg3c,), (seg4c,) = p3.intersect(p4) (seg4d,), (seg1d,) = p4.intersect(p1) area = p1.split([seg1a, seg1d])[1] << p4.split([seg4d, seg4c])[1] << p3.split([seg3c, seg3b])[1] << p2.split([seg2b, seg2a])[1] - area.append(path.closepath()) + area.normsubpaths[-1].close() g.stroke(area, [style.linewidth.THick, deco.filled([color.gray(0.5)])]) def test_allerrorbars(c, x, y): -- 2.11.4.GIT