|
From: John H. <jd...@gm...> - 2007-03-07 18:11:38
|
On 3/7/07, kc1...@ya...
<kc1...@ya...> wrote:
> Upon working with this a little further, I discover that it works only in full-view screen mode. May be that's because xy is in pixel mode then? When I save it to a png file and then view it, the lines are wrong.
The default coords in the example I posted are in pixels -- when you
save, you are probably using a different DPI (this is configurable)
and so the lines have slightly different positions. You can use
relative coords with the "transFigure" transform
from matplotlib.lines import Line2D
from pylab import figure, show, nx
fig = figure()
line = Line2D([0.1,0.2,0.3,0.4,0.5], [0.1,0.4, 0.35, 0.2, 0.5],
linewidth=4, color='green', transform=fig.transFigure)
fig.lines.append(line)
show()
|