Add an `.Artist` to the Axes; return the artist. Use `add_artist` only for artists for which there is no dedicated "add" method; and if necessary, use a method such as `update_datalim` to manually update the `~.Axes.dataLim` if the artist is to be included i
(self, a)
| 2335 | for a in self._children) |
| 2336 | |
| 2337 | def add_artist(self, a): |
| 2338 | """ |
| 2339 | Add an `.Artist` to the Axes; return the artist. |
| 2340 | |
| 2341 | Use `add_artist` only for artists for which there is no dedicated |
| 2342 | "add" method; and if necessary, use a method such as `update_datalim` |
| 2343 | to manually update the `~.Axes.dataLim` if the artist is to be included |
| 2344 | in autoscaling. |
| 2345 | |
| 2346 | If no ``transform`` has been specified when creating the artist (e.g. |
| 2347 | ``artist.get_transform() == None``) then the transform is set to |
| 2348 | ``ax.transData``. |
| 2349 | """ |
| 2350 | a.axes = self |
| 2351 | self._children.append(a) |
| 2352 | a._remove_method = self._children.remove |
| 2353 | self._set_artist_props(a) |
| 2354 | if a.get_clip_path() is None: |
| 2355 | a.set_clip_path(self.patch) |
| 2356 | self.stale = True |
| 2357 | return a |
| 2358 | |
| 2359 | def add_child_axes(self, ax): |
| 2360 | """ |