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

Fix draw on show#4503

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
efiring merged 6 commits intomatplotlib:masterfromtacaswell:fix_draw_on_show
Jun 28, 2015
Merged

Conversation

tacaswell
Copy link
Member

Fixes one of the issues raised in comments onb2fbae7

This needs testing on gtk, gkt3, wx, and osx, but I am pretty confident it will work (or at least do no harm).

If a window is shown due to being in interactive mode, calldraw_idle.  This draw will be executed when the next timepython is idle.  This makes running plotting scripts with  python -i test.pycorrectly auto-display/draw when dropping into the repl.
@tacaswelltacaswell added this to thenext point release milestoneJun 8, 2015
tacaswell referenced this pull requestJun 8, 2015
With the repl callback the pyplot function do not need tocall `draw_if_interactive`.
@tacaswell
Copy link
MemberAuthor

note to self: look at how nbagg deals with this (which is a bit funny) and maybe currently broken.

@OceanWolf You should be aware of this for your Gcf related PR.

@OceanWolf
Copy link
Member

Ahh, thanks for the heads up.

@tacaswelltacaswell mentioned this pull requestJun 8, 2015
@WeatherGod
Copy link
Member

@tacaswell , is the note to self an indication that you want to expand this PR to include nbagg, or that nbagg would need to be worked on in a separate PR?

@@ -1236,6 +1236,7 @@ def new_figure_manager_given_figure(num, figure):
figmgr = frame.get_figure_manager()
if matplotlib.is_interactive():
figmgr.frame.Show()
figure.canvas.draw_idle()
Copy link
Member

Choose a reason for hiding this comment

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

I seem to recall that draw_idle() in wx can be broken sometimes. Would it make sense to make all of these befigure.canvas.draw() instead as this isn't a performance-critical portion of the code? We should probably guarantee an image upon initial display.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

@mdehoon convinced me that in almost all cases we want to usedraw_idle to play nice with the crankier event loops (and most of the backends have some 'I have been told to draw, but have not' so the later calls todraw_idle get no-oped, rather than stacking up draw commands.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Sorry, now re-reading this and understanding it correctly. I think you are reffering to the issue fixed by#3905 so I am inclined to leave this as-is unless a Wx users says otherwise.

 - white space clean up - removed dead (commented out) code
 - moved `is_interactive` import to top of file - remove unused import (contextmanager, backend_agg)
dicts have a len, do not need to get length of the values list/iterator.
Removing the `draw_if_interactive` from `pyplot.figure` inb2fbae7 causes the figures to no longerbe shown on creation in nbagg, this special-cases the manager creatingin nbagg to ensure that the figure is indeed shown.The root cause of this is that unlike every other backend which call`show` in either the Manager `__init__` or one of the`new_figure_manager` functions, nbagg did not
@tacaswelltacaswell added the Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. labelJun 27, 2015
@tacaswell
Copy link
MemberAuthor

I think this ready to go again.

efiring added a commit that referenced this pull requestJun 28, 2015
@efiringefiring merged commit326ccd6 intomatplotlib:masterJun 28, 2015
@tacaswelltacaswell deleted the fix_draw_on_show branchJune 28, 2015 03:59
efiring referenced this pull requestJul 12, 2015
There is still one `draw_if_interactive` left in the `rcdefaults`call as the current scheme does not track when rcparams change.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
Release criticalFor bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions.
Projects
None yet
Milestone
v1.5.0
Development

Successfully merging this pull request may close these issues.

4 participants
@tacaswell@OceanWolf@WeatherGod@efiring

[8]ページ先頭

©2009-2025 Movatter.jp