Commit 73d1af2
committed
Move draw_if_interactive logic to new_figure_manager_given_figure.
Currently, Matplotlib only ever calls draw_if_interactive at the end of
`plt.figure()` (and upon figure unpickling), i.e. this is a mechanism to
further customize handling of newly generated figures. (Prior to
Matplotlib 1.5, draw_if_interactive was also called at the end of all
pyplot functions to trigger a figure redraw, but this is now handled by
the stale attribute.)
In order to simplify the backend API ("what is the API that a backend
module must/can provide", I am planning to deprecate (on Matplotlib's
side) the ability for backends to provide a draw_if_interactive
function (forcing them to always do `if interactive(): draw_idle()`).
Instead, any relevant new-figure-customization logic can instead go
into `new_figure_manager_given_figure`. This PR implements this change
for ipympl, and should be fully back-compatible all the way back to
Matplotlib 1.5. I would like to make these changes first on the side
of the clients (i.e., the third-party backends), to catch any possible
problems with the intended change on Matplotlib's side.1 parent 913431e commit 73d1af2
1 file changed
+15
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
495 | 495 | | |
496 | 496 | | |
497 | 497 | | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
498 | 513 | | |
499 | 514 | | |
500 | 515 | | |
| |||
523 | 538 | | |
524 | 539 | | |
525 | 540 | | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | | - | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
539 | | - | |
540 | | - | |
541 | | - | |
542 | | - | |
543 | | - | |
544 | | - | |
545 | | - | |
546 | | - | |
547 | | - | |
548 | | - | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | 541 | | |
553 | 542 | | |
554 | 543 | | |
| |||
0 commit comments