Repository navigation
Commit 494e4c7
committed
ENH: redraw callback on Figure in base repl
If we do not have IPython, then the only hook I know of in the repl is
the display hook which is called when ever something is going to be
displayed, not after the execution of the last command has finished (the
reason it exists is to give users a chance to intercept and change the
display of the output, not as a generic call back as we were trying to
use it). In this case register a callback on the `Figure` artist at
creation time to call `draw_idle` on the canvas if the Figure is stale.
We are guaranteed to see this at least once when stale is flipped to
True, but may see it more than once if other paths call `pchanged()`.
Fortunately, `pchanged` is not widely used in the internal code base and
even if `draw_idle` is called multiple times, we should be able to count
on the backends handling multiple draw_idle commands correctly.
Closes matplotlib#45041 parent 1b83af3 commit 494e4c7
1 file changed
Lines changed: 12 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
111 | | - | |
112 | 111 | | |
113 | | - | |
| 112 | + | |
114 | 113 | | |
115 | 114 | | |
116 | 115 | | |
| |||
119 | 118 | | |
120 | 119 | | |
121 | 120 | | |
122 | | - | |
123 | 121 | | |
| 122 | + | |
124 | 123 | | |
125 | 124 | | |
126 | 125 | | |
| |||
148 | 147 | | |
149 | 148 | | |
150 | 149 | | |
| 150 | + | |
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
| 154 | + | |
166 | 155 | | |
167 | 156 | | |
168 | 157 | | |
| |||
181 | 170 | | |
182 | 171 | | |
183 | 172 | | |
184 | | - | |
185 | 173 | | |
| 174 | + | |
186 | 175 | | |
187 | 176 | | |
188 | 177 | | |
| |||
193 | 182 | | |
194 | 183 | | |
195 | 184 | | |
196 | | - | |
197 | | - | |
198 | | - | |
| 185 | + | |
| 186 | + | |
199 | 187 | | |
200 | 188 | | |
201 | 189 | | |
| |||
541 | 529 | | |
542 | 530 | | |
543 | 531 | | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
544 | 537 | | |
545 | 538 | | |
546 | 539 | | |
| |||
0 commit comments