MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / _auto_draw_if_interactive

Function _auto_draw_if_interactive

lib/matplotlib/pyplot.py:1128–1146  ·  view source on GitHub ↗

An internal helper function for making sure that auto-redrawing works as intended in the plain python repl. Parameters ---------- fig : Figure A figure object which is assumed to be associated with a canvas

(fig, val)

Source from the content-addressed store, hash-verified

1126
1127
1128def _auto_draw_if_interactive(fig, val):
1129 """
1130 An internal helper function for making sure that auto-redrawing
1131 works as intended in the plain python repl.
1132
1133 Parameters
1134 ----------
1135 fig : Figure
1136 A figure object which is assumed to be associated with a canvas
1137 """
1138 if (val and matplotlib.is_interactive()
1139 and not fig.canvas.is_saving()
1140 and not fig.canvas._is_idle_drawing):
1141 # Some artists can mark themselves as stale in the middle of drawing
1142 # (e.g. axes position & tick labels being computed at draw time), but
1143 # this shouldn't trigger a redraw because the current redraw will
1144 # already take them into account.
1145 with fig.canvas._idle_draw_cntx():
1146 fig.canvas.draw_idle()
1147
1148
1149def gcf() -> Figure:

Callers

nothing calls this directly

Calls 3

is_savingMethod · 0.80
_idle_draw_cntxMethod · 0.80
draw_idleMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…