Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Bug]: Figure does not scale to window size #22822

Open
Labels
@thomas-haslwanter

Description

@thomas-haslwanter

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

scaling_problem_01

Expected outcome

When the size of the window is then MANUALLY changed, the figure immediately changes to the accurate scale:
scaling_problem_02

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp