Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Commit34e84e1
committed
Add SubplotSpec.add_subplot.
Now that the preferred(?) method of creating GridSpecs attaches theGridSpec to a given figure (figure.add_gridspec), calling`fig.add_subplot(gs[...])` effectively specifies the figure informationtwice. Hence, allow one to do```gs = fig.add_gridspec(2, 2)gs[0, 0].add_subplot()```as a synonym for```gs = fig.add_gridspec(2, 2)fig.add_subplot(gs[0, 0])```Ideally, this should ultimately allow one to deprecate the somewhatunwieldy subplot2grid, replacing```plt.subplot2grid((3, 3), (0, 0))plt.subplot2grid((3, 3), (1, 1), rowspan=2, colspan=2)```by```plt.figure().add_grispec(3, 3)[0, 0].add_subplot()plt.figure().add_grispec(3, 3)[1:, 1:].add_subplot()```or, after implementing a plt.add_gridspec() that operates on gcf(),```gs = plt.add_gridspec(3, 3)gs[0, 0].add_subplot()gs[1:, 1:].add_subplot()```A similar API change would be to make GridSpec.tight_layout() lose its`figure` argument (or rather, it could become optional).1 parent2660901 commit34e84e1
File tree
4 files changed
+63
-32
lines changed- doc/users/next_whats_new
- lib/matplotlib
- tests
- tutorials/intermediate
4 files changed
+63
-32
lines changedLines changed: 8 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + |
Lines changed: 24 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
371 | 371 |
| |
372 | 372 |
| |
373 | 373 |
| |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
374 | 378 |
| |
375 | 379 |
| |
376 | 380 |
| |
| |||
542 | 546 |
| |
543 | 547 |
| |
544 | 548 |
| |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + |
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
107 | 107 |
| |
108 | 108 |
| |
109 | 109 |
| |
110 |
| - | |
| 110 | + | |
111 | 111 |
| |
112 | 112 |
| |
113 |
| - | |
| 113 | + | |
114 | 114 |
| |
115 | 115 |
| |
116 | 116 |
| |
|
Lines changed: 29 additions & 30 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
49 | 49 |
| |
50 | 50 |
| |
51 | 51 |
| |
52 |
| - | |
53 |
| - | |
54 |
| - | |
| 52 | + | |
| 53 | + | |
55 | 54 |
| |
56 | 55 |
| |
57 | 56 |
| |
58 | 57 |
| |
59 | 58 |
| |
60 |
| - | |
61 |
| - | |
62 |
| - | |
63 |
| - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
64 | 63 |
| |
65 | 64 |
| |
66 | 65 |
| |
| |||
74 | 73 |
| |
75 | 74 |
| |
76 | 75 |
| |
77 |
| - | |
| 76 | + | |
78 | 77 |
| |
79 |
| - | |
| 78 | + | |
80 | 79 |
| |
81 |
| - | |
| 80 | + | |
82 | 81 |
| |
83 |
| - | |
| 82 | + | |
84 | 83 |
| |
85 |
| - | |
| 84 | + | |
86 | 85 |
| |
87 | 86 |
| |
88 | 87 |
| |
| |||
99 | 98 |
| |
100 | 99 |
| |
101 | 100 |
| |
102 |
| - | |
| 101 | + | |
103 | 102 |
| |
104 |
| - | |
105 |
| - | |
106 |
| - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
107 | 106 |
| |
108 | 107 |
| |
109 | 108 |
| |
| |||
121 | 120 |
| |
122 | 121 |
| |
123 | 122 |
| |
124 |
| - | |
| 123 | + | |
125 | 124 |
| |
126 | 125 |
| |
127 | 126 |
| |
| |||
154 | 153 |
| |
155 | 154 |
| |
156 | 155 |
| |
157 |
| - | |
| 156 | + | |
158 | 157 |
| |
159 | 158 |
| |
160 | 159 |
| |
| |||
172 | 171 |
| |
173 | 172 |
| |
174 | 173 |
| |
175 |
| - | |
176 |
| - | |
177 |
| - | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
178 | 177 |
| |
179 | 178 |
| |
180 | 179 |
| |
| |||
185 | 184 |
| |
186 | 185 |
| |
187 | 186 |
| |
188 |
| - | |
189 |
| - | |
190 |
| - | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
191 | 190 |
| |
192 | 191 |
| |
193 | 192 |
| |
194 |
| - | |
195 |
| - | |
196 |
| - | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
197 | 196 |
| |
198 | 197 |
| |
199 | 198 |
| |
| |||
214 | 213 |
| |
215 | 214 |
| |
216 | 215 |
| |
217 |
| - | |
218 |
| - | |
| 216 | + | |
| 217 | + | |
219 | 218 |
| |
220 | 219 |
| |
221 | 220 |
| |
| |||
276 | 275 |
| |
277 | 276 |
| |
278 | 277 |
| |
279 |
| - | |
280 | 278 |
| |
| 279 | + | |
281 | 280 |
| |
282 | 281 |
|
0 commit comments
Comments
(0)