Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Open
Labels
Description
Bug summary
When changing the window size of a figure, the figure does not scale immediately, so part of it is obscured. Only after a manual re-scaling (even if minute) the figure is displayed correctly.
Code for reproduction
importnumpyasnpimportmatplotlib.pyplotasplt# Generate some datat=np.arange(0,10,0.1)x=np.cos(t)fig,ax=plt.subplots(1,1)# Put the figure in the top-left half of the screencur_win=fig.canvas.manager.window# Current windowscreen_size=cur_win.wm_maxsize()# Get the screen size# top-left half of the window:(pos_x,pos_y,width,height)= (0,0,screen_size[0]//2,screen_size[1]//2)position=f'{width}x{height}+{pos_x}+{pos_y}'# Window geometry stringcur_win.geometry(position)ax.plot(t,x)plt.show()
Actual outcome
Expected outcome
When the size of the window is then MANUALLY changed, the figure immediately changes to the accurate scale:
Additional information
The bug appears from Matplotlib 3.5.1 onward
Operating system
Windows 11
Matplotlib Version
3.5.1
Matplotlib Backend
TkAgg
Python version
3.9.10
Jupyter version
No response
Installation
No response