Hi

sorry if this is seems a trivial request but I am trying to read a set of 
polygons from file and plot them using PyX.  PyX runs OK (ie no errors) but 
nothing appears on the canvas!  The file contains data in this form

poly_1, x0, y0
poly_1, x1, y1
...
poly_2, x0, y0

Here is a code snippet

in_file=open("myfile","r")
c=canvas.canvas()

for line in in_file
     # ... stuff here to read the polygon name and (x,y) coords as x0, y0

        if (encountered_new_polygon_name):
                # plot previous polygon
                p.append(path.closepath())
                c.stroke(p)             

                # reset path and start new path
                p=path.path(path.moveto(x0,y0))
        else
                # still on same polygon so append data
                p.append(path(lineto(x0,y0))

All help gratefully received!  Thanks!!




_______________________________________________
PyX-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyx-user

Reply via email to