[Matplotlib-users] axes.get_position() inaccurate until after savefig()?

2015-02-18 Thread gdm
New matplotlib user here. Sometimes I like to make figures with multiple axes, and have lines that cross multiple axes. I've run in to problems with coordinates when doing this. One such problem is that axes.get_position() seems to return incorrect coordinates for an axes with a fixed aspect rat

Re: [Matplotlib-users] axes.get_position() inaccurate until after savefig()?

2015-02-18 Thread Ryan Nelson
I don't have an answer to your question exactly. But I'll just say that this does make sense. The aspect-corrected axes (after show) is a subset of what you originally asked for, i.e. the bottom is higher, and the height is smaller. My guess is that this is not calculated until the final rendering

Re: [Matplotlib-users] axes.get_position() inaccurate until after savefig()?

2015-02-18 Thread Eric Firing
On 2015/02/18 7:51 AM, Ryan Nelson wrote: > I don't have an answer to your question exactly. But I'll just say that > this does make sense. The aspect-corrected axes (after show) is a subset > of what you originally asked for, i.e. the bottom is higher, and the > height is smaller. My guess is that

Re: [Matplotlib-users] axes.get_position() inaccurate until after savefig()?

2015-02-19 Thread gdm
Ok, axes.apply_aspect() seems to work. The other obvious kluge I had found was to save the figure twice, once before and once after I accessed the axes position. It seems the more elegant solution might be to use a somewhat-complicated transform, so that that the two endpoints of a Line2d segme