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)
| 1126 | |
| 1127 | |
| 1128 | def _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 | |
| 1149 | def gcf() -> Figure: |
nothing calls this directly
no test coverage detected
searching dependent graphs…