Skip to content

Commit e5593b5

Browse files
committed
ENH: make the figures list on FigureContext public
1 parent d1b8156 commit e5593b5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

mpl_gui/__init__.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -99,35 +99,35 @@ def __init__(self, *, block=None, timeout=0, forgive_failure=False):
9999
self._timeout = timeout
100100
self._forgive_failure = forgive_failure
101101
self._block = block
102-
self._figs = []
102+
self.figures = []
103103

104104
def __enter__(self):
105105
# TODO only allow the creation methods to work when in the context
106-
self._figs.clear()
106+
self.figures.clear()
107107
return self
108108

109109
@functools.wraps(figure)
110110
def figure(self, *args, **kwargs):
111111
fig = figure(*args, **kwargs)
112-
self._figs.append(fig)
112+
self.figures.append(fig)
113113
return fig
114114

115115
@functools.wraps(subplots)
116116
def subplots(self, *args, **kwargs):
117117
fig, axs = subplots(*args, **kwargs)
118-
self._figs.append(fig)
118+
self.figures.append(fig)
119119
return fig, axs
120120

121121
@functools.wraps(subplot_mosaic)
122122
def subplot_mosaic(self, *args, **kwargs):
123123
fig, axd = subplot_mosaic(*args, **kwargs)
124-
self._figs.append(fig)
124+
self.figures.append(fig)
125125
return fig, axd
126126

127127
def __exit__(self, exc_type, exc_value, traceback):
128128
if exc_value is not None and not self._forgive_failure:
129129
return
130-
show(self._figs, block=self._block, timeout=self._timeout)
130+
show(self.figures, block=self._block, timeout=self._timeout)
131131

132132
def show(self):
133133
show(self._figs, block=self._block, timeout=self._timeout)

0 commit comments

Comments
 (0)