-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
auto legend position changes upon saving the figure #7353
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The first time it saves: Saving after letting it render to the screen And they are slightly different sizes In [63]: mimg.imread('/tmp/foo.png').shape
Out[63]:
(480, 640, 4)
In [64]: mimg.imread('/tmp/foo2.png').shape
Out[64]:
(471, 640, 4) Which leads to the even weirder observation that In [108]: plt.gcf().set_size_inches([6.4, 4.7], forward=True); print(plt.gcf().bbox_inches); print(plt.gcf().get_size_inches())
Bbox(x0=0.0, y0=0.0, x1=6.4, y1=4.61)
[ 6.4 4.61]
In [109]: plt.gcf().set_size_inches([6.4, 4.7], forward=True); print(plt.gcf().bbox_inches); print(plt.gcf().get_size_inches())
Bbox(x0=0.0, y0=0.0, x1=6.4, y1=4.7)
[ 6.4 4.7] This seems to be related to something going wrong with the conversion between the size of the canvas and the size of the qt window. |
Even though the minimum height is set, that doesn't seem to carry over to the size hint that gets used later to determine the size of the entire window, causing the window to be a bit too short and changing the size of the canvas. Fixes matplotlib#7353. Probably also fixes matplotlib#7472.
Even though the minimum height is set, that doesn't seem to carry over to the size hint that gets used later to determine the size of the entire window, causing the window to be a bit too short and changing the size of the canvas. Fixes matplotlib#7353. Probably also fixes matplotlib#7472.
closed by #7610 |
2.0b4 and master
The displayed window puts the legend at the center top of the figure, but the saved image puts the legend at the bottom left.
By changing the seed one can get cases where the two legends do match each other. In that case, careful inspection of the images show that the legends have slightly different sizes, which make them overlap with different number of points depending on the corner in which they are tentatively placed by the autolocator -- this is what leads to them moving upon saving.
The text was updated successfully, but these errors were encountered: