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

Add a draw during show for macos backend#27955

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
tacaswell merged 1 commit intomatplotlib:mainfromksunden:macos_show_draw
Apr 3, 2024

Conversation

ksunden
Copy link
Member

Without this a stale figure is shown

PR summary

This is basically the same concept as what happens just before show inplt.pause.

Essentially, there is nothing in the macos backend that actually causes a stale figure to be redrawn onshow.
Other backends (qt, tk in particular, but likely others) seem to be saved by the fact that a resize event is triggered upon show, but macos does not do the same.

Other ideas considered, would be to do this inplt.show (which would perhaps leave out some other mechanisms, such as mpl-gui) or to try and do this in backend_bases (which is hard because most do not callsuper).
Could also leave out the condition and just always calldraw_idle.

closes#27953

PR checklist

Without this a stale figure is shown
@QuLogicQuLogic added this to thev3.8.4 milestoneMar 21, 2024
@QuLogicQuLogic requested a review fromgreglucasMarch 21, 2024 00:27
Copy link
Contributor

@greglucasgreglucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Thanks for the pointer about this needing to be run in a terminal and not a script. I can reproduce the original issue that way.

This fixes the issue, so has my approval and is good to go in. But I am still not sure whether there is a deeper issue here with the way we are setting the interrupt handling that this is just covering up in a sense by forcing another event through.

In the__init__ method, we are actually following the call toself.show() with adraw_idle(). I'm wondering if we can either remove that call now, or if we should just be callingdraw_idle() here regardless of whether we are stale or not like above.

ifmpl.is_interactive():
self.show()
self.canvas.draw_idle()

@ksunden
Copy link
MemberAuthor

Ping for second review here, I'd like to get this in for 3.8.4, which I would like to get out soon for np2 reasons.

I'm not too concerned about potentially doubling up draw_idle requests here, as they are intentionally pretty cheap in the first place. I am more interested in getting the fix in than tracking down if other calls could possibly be omitted.

I think it is likely correct that we could omit the call in__init__ (even with the stale check), but also think the performance concern is quite minimal and am not 100% sure. (I would be pretty sure if we omitted the stale check, but not clear to me which would be "better")

@tacaswelltacaswell merged commitd0faf22 intomatplotlib:mainApr 3, 2024
@ksundenksunden deleted the macos_show_draw branchApril 3, 2024 19:11
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull requestApr 3, 2024
QuLogic added a commit that referenced this pull requestApr 3, 2024
…955-on-v3.8.xBackport PR#27955 on branch v3.8.x (Add a draw during show for macos backend)
@ksundenksunden mentioned this pull requestApr 4, 2024
5 tasks
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@greglucasgreglucasgreglucas approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.8.4
Development

Successfully merging this pull request may close these issues.

[Bug]: Pyplot can no longer set axes properties
4 participants
@ksunden@greglucas@tacaswell@QuLogic

[8]ページ先頭

©2009-2025 Movatter.jp