From: Joerg L. <jo...@us...> - 2004-12-03 09:17:03
|
Hi, On 03.12.04, Andrea Riciputi wrote: > I'm struggling with changecircle and friends but, despite the fact I've > read the manual and studied somewhat the code, I can't understad how > they work and how I use them in my PyX scripts. > > Suppose I have the following datas structure: > > data = [[first data series],[second data series], ...] > > where each data series is a 2-dim list (such as [x0,y0],[x1,y1],...). > I've tried to use changecircle in the following way: > > h = pyx.graph.graphxy(blah, blah, blah...) > h.plot([pyx.graph.data.list(data[i], x=1, y=2) for i in > range(len(data))], [pyx.graph.style.symbol(symbol = > pyx.graph.style.symbol.changecircle)]) The following example works for me with PyX 0.7: #!/usr/bin/env python from pyx import * data = [ [ (1, 1), (2, 2), (3, 3) ], [ (1, 1), (2, 4), (3, 9)] ] g = graph.graphxy(width=10) g.plot([graph.data.list(date, x=1, y=2) for date in data], [graph.style.symbol(symbol=graph.style.symbol.changecircle)]) g.writeEPSfile("test") [ Btw: Please always send a complete example to show that something doesn't work as it should. This way it's much easier for others to test it. ] Jörg |