From 1338c4e8a57d3dc5eb9671bcd0719dd526be5801 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Andr=C3=A9=20Wobst?= Date: Wed, 3 Oct 2007 21:43:46 +0000 Subject: [PATCH] list->points renaming git-svn-id: https://pyx.svn.sourceforge.net/svnroot/pyx/trunk/pyx@2896 069f4177-920e-0410-937b-c2a4a81bcd90 --- examples/graphstyles/cal.py | 18 +++++++++--------- examples/graphstyles/changesymbol.py | 6 +++--- examples/graphstyles/histogram.py | 10 +++++----- examples/splitgraphs/minimal.py | 12 ++++++------ 4 files changed, 23 insertions(+), 23 deletions(-) diff --git a/examples/graphstyles/cal.py b/examples/graphstyles/cal.py index ce61d2a3..58d71697 100644 --- a/examples/graphstyles/cal.py +++ b/examples/graphstyles/cal.py @@ -36,7 +36,7 @@ class daystyle(graph.style._style): graph.text_pt(x1_pt+3, y1_pt+3, point["note"], [text.size.tiny]) # create calendar data -year = 2006 +year = 2007 notes = {1: {17: r"\PyX{} 0.2 (2003)", 20: r"\PyX{} 0.5 (2004)", 22: r"\PyX{} 0.5.1 (2004)"}, 3: {30: r"\PyX{} 0.6 (2004)", 31: r"\PyX{} 0.3 ('03), \PyX{} 0.6.1 ('04)"}, 4: {4: r"\PyX{} 0.3.1 (2003)", 7: r"\PyX{} 0.6.2 (2004)", 27: r"\PyX{} 0.6.3 (2004)"}, @@ -44,15 +44,15 @@ notes = {1: {17: r"\PyX{} 0.2 (2003)", 20: r"\PyX{} 0.5 (2004)", 22: r"\PyX{} 0. 7: {13: r"\PyX{} 0.8 (2005)"}, 8: {13: r"\PyX{} 0.8.1 (2005)", 22: r"\PyX{} 0.4 (2003)"}, 9: {17: r"\PyX{} 0.4.1 (2003)"}, - 10: {7: r"\PyX{} 0.1 (2002)", 21: r"\PyX{} 0.7 (2004)"}, + 10: {3: r"\PyX{} 0.10 (2007)", 7: r"\PyX{} 0.1 (2002)", 21: r"\PyX{} 0.7 (2004)"}, 12: {15: r"\PyX{} 0.7.1 (2004)"}} -d = graph.data.list([(day, - calendar.month_name[month], - calendar.day_abbr[calendar.weekday(year, month, day)], - notes.get(month, {}).get(day)) - for month in range(1, 13) - for day in range(1, calendar.monthrange(year, month)[1]+1)], - day=1, month=2, weekday=3, note=4) +d = graph.data.points([(day, + calendar.month_name[month], + calendar.day_abbr[calendar.weekday(year, month, day)], + notes.get(month, {}).get(day)) + for month in range(1, 13) + for day in range(1, calendar.monthrange(year, month)[1]+1)], + day=1, month=2, weekday=3, note=4) # create the calendar g = graph.graphxy(width=40, x2=graph.axis.bar(dist=0, linkpainter=None), diff --git a/examples/graphstyles/changesymbol.py b/examples/graphstyles/changesymbol.py index fb48e852..cb0d1a0a 100644 --- a/examples/graphstyles/changesymbol.py +++ b/examples/graphstyles/changesymbol.py @@ -35,9 +35,9 @@ class changesymbol(graph.style.symbol): privatedata.symbolattrs + [color]) g = graph.graphxy(width=10) -g.plot(graph.data.list([[random.random() for i in range(4)] - for i in range(1000)], - x=1, y=2, size=3, color=4), +g.plot(graph.data.points([[random.random() for i in range(4)] + for i in range(1000)], + x=1, y=2, size=3, color=4), [changesymbol()]) g.writeEPSfile("changesymbol") g.writePDFfile("changesymbol") diff --git a/examples/graphstyles/histogram.py b/examples/graphstyles/histogram.py index 9cd403e9..de940249 100644 --- a/examples/graphstyles/histogram.py +++ b/examples/graphstyles/histogram.py @@ -1,10 +1,10 @@ from pyx import * -d = graph.data.list([(1, 0.3), - (2, -0.7), - (3, -0.3), - (4, 0.8), - (5, 0.5)], x=1, y=2) +d = graph.data.points([(1, 0.3), + (2, -0.7), + (3, -0.3), + (4, 0.8), + (5, 0.5)], x=1, y=2) g = graph.graphxy(width=8) g.plot(d, [graph.style.histogram()]) diff --git a/examples/splitgraphs/minimal.py b/examples/splitgraphs/minimal.py index 01d3c7de..cc74a5eb 100644 --- a/examples/splitgraphs/minimal.py +++ b/examples/splitgraphs/minimal.py @@ -1,11 +1,11 @@ from pyx import * g = graph.graphxy(width=8, x=graph.axis.split()) -g.plot(graph.data.list([((0, 0.1), 0.1), - ((0, 0.5), 0.2), - ((0, 0.9), 0.3), - ((1, 101), 0.7), - ((1, 105), 0.8), - ((1, 109), 0.9)], x=1, y=2)) +g.plot(graph.data.points([((0, 0.1), 0.1), + ((0, 0.5), 0.2), + ((0, 0.9), 0.3), + ((1, 101), 0.7), + ((1, 105), 0.8), + ((1, 109), 0.9)], x=1, y=2)) g.writeEPSfile("minimal") g.writePDFfile("minimal") -- 2.11.4.GIT