There was an error while loading. Please reload this page.
1 parent 2d337ac commit 4a64f3dCopy full SHA for 4a64f3d
1 file changed
lib/matplotlib/figure.py
@@ -392,6 +392,9 @@ def __init__(self,
392
self._align_xlabel_grp = cbook.Grouper()
393
self._align_ylabel_grp = cbook.Grouper()
394
395
+ # list of child gridspecs for this figure
396
+ self._gridspecs = []
397
+
398
# TODO: I'd like to dynamically add the _repr_html_ method
399
# to the figure in the right context, but then IPython doesn't
400
# use it, for some reason.
@@ -2298,7 +2301,9 @@ def add_gridspec(self, nrows, ncols, **kwargs):
2298
2301
"""
2299
2302
2300
2303
_ = kwargs.pop('figure', None) # pop in case user has added this...
- return GridSpec(nrows=nrows, ncols=ncols, figure=self, **kwargs)
2304
+ gs = GridSpec(nrows=nrows, ncols=ncols, figure=self, **kwargs)
2305
+ self._gridspecs.append(gs)
2306
+ return gs
2307
2308
2309
def figaspect(arg):
0 commit comments