Hello,

On 04.12.06, Riccardo Campana wrote:
> Hello,
> 
> with the standard command
> g = graph.graphxy(width=8,height=8)
> g.plot(graph.data.file("datafile.dat", x=1, y=2), [graph.style.symbol 
> (graph.style.symbol.circle, size=0.1, symbolattrs=[deco.filled])])
> 
> Now, I want to draw a straight line between some of these points, for  
> example from the point (0.194, 0.854) to the point (0.311, 0.554).
> 
> How can I do this? With path.line() and stroke() the points are not  
> in graph (axis) coordinates...

draw the lines directly on g which is a canvas. g.pos allows you to
convert graph-coordinates into lengths

g.finish()
x1, y1 = g.pos(0.194, 0.854)
x2, y2 = g.pos(0.311, 0.554)
g.stroke(path.line(x1, y1, x2, y2))


If you want lines between all the points, just say instead in your
plot command

graph.style.line()

in addition to graph.style.symbol(...)

Michael.

-- 
"A mathematician is a device for turning coffee into theorems"
  Paul Erdös.

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user

Reply via email to