@@ -666,24 +666,18 @@ def clf():
666
666
667
667
668
668
def draw ():
669
- """
670
- Redraw the current figure.
669
+ """Redraw the current figure.
671
670
672
- This is used in interactive mode to update a figure that
673
- has been altered using one or more plot object method calls;
674
- it is not needed if figure modification is done entirely
675
- with pyplot functions, if a sequence of modifications ends
676
- with a pyplot function, or if matplotlib is in non-interactive
677
- mode and the sequence of modifications ends with :func:`show` or
678
- :func:`savefig`.
671
+ This is used in interactive mode to update a figure that has been
672
+ altered, but not automatically re-drawn. This should be only rarely
673
+ needed, but there may be ways to modify the state of a figure with
674
+ out marking it as `stale`. Please report these cases as bugs.
679
675
680
676
A more object-oriented alternative, given any
681
677
:class:`~matplotlib.figure.Figure` instance, :attr:`fig`, that
682
678
was created using a :mod:`~matplotlib.pyplot` function, is::
683
679
684
680
fig.canvas.draw_idle()
685
-
686
-
687
681
"""
688
682
get_current_fig_manager ().canvas .draw_idle ()
689
683
@@ -692,7 +686,7 @@ def draw():
692
686
def savefig (* args , ** kwargs ):
693
687
fig = gcf ()
694
688
res = fig .savefig (* args , ** kwargs )
695
- draw () # need this if 'transparent=True' to reset colors
689
+ fig . canvas . draw_idle () # need this if 'transparent=True' to reset colors
696
690
return res
697
691
698
692
0 commit comments