Commit bc31177
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 011d12f commit bc31177
3 files changed
+43
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
933 | 933 | | |
934 | 934 | | |
935 | 935 | | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
936 | 940 | | |
937 | 941 | | |
938 | 942 | | |
| |||
1019 | 1023 | | |
1020 | 1024 | | |
1021 | 1025 | | |
| 1026 | + | |
1022 | 1027 | | |
1023 | 1028 | | |
1024 | 1029 | | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
1025 | 1035 | | |
1026 | 1036 | | |
1027 | | - | |
1028 | | - | |
1029 | | - | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
| 1044 | + | |
| 1045 | + | |
1030 | 1046 | | |
1031 | 1047 | | |
1032 | 1048 | | |
1033 | 1049 | | |
1034 | 1050 | | |
1035 | 1051 | | |
1036 | | - | |
1037 | 1052 | | |
1038 | 1053 | | |
1039 | 1054 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
151 | | - | |
152 | 150 | | |
153 | 151 | | |
154 | 152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
471 | 471 | | |
472 | 472 | | |
473 | 473 | | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
474 | 498 | | |
475 | 499 | | |
476 | 500 | | |
| |||
0 commit comments