Commit 0e13c82
committed
ENH: Allow to register standalone figures with pyplot
It may be fundamentally nice not to have to create the figure
though pyplot to be able to use it in pyplot afterwards. You can now do
```
from matplotlib.figure import Figure
import matplotlib.pyplot as plt
fig = Figure()
fig.subplots().plot([1, 3, 2])
plt.figure(fig) # fig is now tracked in pyplot
plt.show()
```
This also opens up the possibility to more dynamically track
and untrack figures in pyplot, which opens up the road to
optimized figure tracking in pyplot (matplotlib#29849)1 parent 77993d5 commit 0e13c82
2 files changed
+39
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
990 | 990 | | |
991 | 991 | | |
992 | 992 | | |
| 993 | + | |
993 | 994 | | |
994 | 995 | | |
995 | 996 | | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
| 1000 | + | |
| 1001 | + | |
996 | 1002 | | |
997 | 1003 | | |
998 | | - | |
999 | | - | |
1000 | | - | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
1001 | 1013 | | |
1002 | 1014 | | |
1003 | 1015 | | |
1004 | 1016 | | |
1005 | 1017 | | |
1006 | 1018 | | |
1007 | | - | |
1008 | 1019 | | |
1009 | 1020 | | |
1010 | 1021 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
470 | 470 | | |
471 | 471 | | |
472 | 472 | | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
473 | 497 | | |
474 | 498 | | |
475 | 499 | | |
| |||
0 commit comments