10000 FIX: set internal flags first in FigureCanvasBase by tacaswell · Pull Request #5150 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

FIX: set internal flags first in FigureCanvasBase #5150

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

Merged
merged 7 commits into from
Sep 27, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
DOC: update plt.draw docstring
  • Loading branch information
tacaswell committed Sep 27, 2015
commit 621b98cd1151365e64162cb58daf000b11ca1152
18 changes: 6 additions & 12 deletions lib/matplotlib/pyplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,24 +666,18 @@ def clf():


def draw():
"""
Redraw the current figure.
"""Redraw the current figure.

This is used in interactive mode to update a figure that
has been altered using one or more plot object method calls;
it is not needed if figure modification is done entirely
with pyplot functions, if a sequence of modifications ends
with a pyplot function, or if matplotlib is in non-interactive
mode and the sequence of modifications ends with :func:`show` or
:func:`savefig`.
This is used in interactive mode to update a figure that has been
altered, but not automatically re-drawn. This should be only rarely
needed, but there may be ways to modify the state of a figure with
out marking it as `stale`. Please report these cases as bugs.

A more object-oriented alternative, given any
:class:`~matplotlib.figure.Figure` instance, :attr:`fig`, that
was created using a :mod:`~matplotlib.pyplot` function, is::

fig.canvas.draw_idle()


"""
get_current_fig_manager().canvas.draw_idle()

Expand All @@ -692,7 +686,7 @@ def draw():
def savefig(*args, **kwargs):
fig = gcf()
res = fig.savefig(*args, **kwargs)
draw() # need this if 'transparent=True' to reset colors
fig.canvas.draw_idle() # need this if 'transparent=True' to reset colors
return res


Expand Down
0