Thanks for the answer, John and Jouni. Okay, Line2D works. However, it appears to work in point (or is it pixels?) only. It doesn't accept xycoords="figure fraction" as an option. How can I specify xy as a fraction of the figure size?
I read the transform cookbook cited by Jouni. I am afraid I am lost what that does.... Regards, > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On > Behalf Of John Hunter > Sent: Wednesday, March 07, 2007 6:48 AM > To: matplotlib-users@lists.sourceforge.net > Subject: Re: [Matplotlib-users] How to draw a straight line? > > > On 3/6/07, Jouni K. Seppänen <[EMAIL PROTECTED]> wrote: > > [EMAIL PROTECTED] writes: > > > How do I draw a line going from point A to point B on a > figure (not > > It probably makes more sense not to use Axes.plot at all, > since the line is not associated with an Axes > > from matplotlib.lines import Line2D > from pylab import figure, show, nx > > fig = figure() > line = Line2D([100,200,300,400,500], [100,400, 350, 200, 500], > linewidth=4, color='green') > fig.lines.append(line) > show() > > > But this feature isn't used very much, and one thing that we > are not currently supporting (but should) is the zorder for > Artists in the Figure. So if you have an Axes in your plot > and you want the line to go over it, you'll need to do > something like Jouni suggested so the line will be drawn > above the Axes. > > -------------------------------------------------------------- > ----------- > 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 _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- John Henry ------------------------------------------------------------------------- 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 _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users