|
23 | 23 | import matplotlib.axis as maxis |
24 | 24 | import matplotlib.spines as mspines |
25 | 25 | import matplotlib.font_manager as font_manager |
| 26 | +import matplotlib.table as mtable |
26 | 27 | import matplotlib.text as mtext |
27 | 28 | import matplotlib.image as mimage |
28 | 29 | import matplotlib.path as mpath |
@@ -1231,7 +1232,6 @@ def cla(self): |
1231 | 1232 |
|
1232 | 1233 | self._gridOn = mpl.rcParams['axes.grid'] |
1233 | 1234 | self._children = [] |
1234 | | - self.tables = [] |
1235 | 1235 | self.artists = [] |
1236 | 1236 | self.images = [] |
1237 | 1237 | self._mouseover_set = _OrderedSet() |
@@ -1316,6 +1316,10 @@ def patches(self): |
1316 | 1316 | return tuple(a for a in self._children |
1317 | 1317 | if isinstance(a, mpatches.Patch)) |
1318 | 1318 |
|
| 1319 | + @property |
| 1320 | + def tables(self): |
| 1321 | + return tuple(a for a in self._children if isinstance(a, mtable.Table)) |
| 1322 | + |
1319 | 1323 | @property |
1320 | 1324 | def texts(self): |
1321 | 1325 | return tuple(a for a in self._children if isinstance(a, mtext.Text)) |
@@ -2219,12 +2223,12 @@ def _update_patch_limits(self, patch): |
2219 | 2223 |
|
2220 | 2224 | def add_table(self, tab): |
2221 | 2225 | """ |
2222 | | - Add a `~.Table` to the axes' tables; return the table. |
| 2226 | + Add a `~.Table` to the Axes; return the table. |
2223 | 2227 | """ |
2224 | 2228 | self._set_artist_props(tab) |
2225 | | - self.tables.append(tab) |
| 2229 | + self._children.append(tab) |
2226 | 2230 | tab.set_clip_path(self.patch) |
2227 | | - tab._remove_method = self.tables.remove |
| 2231 | + tab._remove_method = self._children.remove |
2228 | 2232 | return tab |
2229 | 2233 |
|
2230 | 2234 | def add_container(self, container): |
@@ -4343,7 +4347,6 @@ def get_children(self): |
4343 | 4347 | *self.spines.values(), |
4344 | 4348 | *self._get_axis_list(), |
4345 | 4349 | self.title, self._left_title, self._right_title, |
4346 | | - *self.tables, |
4347 | 4350 | *self.images, |
4348 | 4351 | *self.child_axes, |
4349 | 4352 | *([self.legend_] if self.legend_ is not None else []), |
|
0 commit comments