MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / add_artist

Method add_artist

lib/matplotlib/figure.py:503–536  ·  view source on GitHub ↗

Add an `.Artist` to the figure. Usually artists are added to `~.axes.Axes` objects using `.Axes.add_artist`; this method can be used in the rare cases where one needs to add artists directly to the figure instead. Parameters ---------- artis

(self, artist, clip=False)

Source from the content-addressed store, hash-verified

501 frameon = property(get_frameon, set_frameon)
502
503 def add_artist(self, artist, clip=False):
504 """
505 Add an `.Artist` to the figure.
506
507 Usually artists are added to `~.axes.Axes` objects using
508 `.Axes.add_artist`; this method can be used in the rare cases where
509 one needs to add artists directly to the figure instead.
510
511 Parameters
512 ----------
513 artist : `~matplotlib.artist.Artist`
514 The artist to add to the figure. If the added artist has no
515 transform previously set, its transform will be set to
516 ``figure.transSubfigure``.
517 clip : bool, default: False
518 Whether the added artist should be clipped by the figure patch.
519
520 Returns
521 -------
522 `~matplotlib.artist.Artist`
523 The added artist.
524 """
525 artist.set_figure(self)
526 self.artists.append(artist)
527 artist._remove_method = self.artists.remove
528
529 if not artist.is_transform_set():
530 artist.set_transform(self.transSubfigure)
531
532 if clip and artist.get_clip_path() is None:
533 artist.set_clip_path(self.patch)
534
535 self.stale = True
536 return artist
537
538 @_docstring.interpd
539 def add_axes(self, *args, **kwargs):

Callers 4

plot_childrenFunction · 0.45
_init_layoutMethod · 0.45
legend_artistMethod · 0.45
add_labelMethod · 0.45

Calls 5

is_transform_setMethod · 0.80
set_figureMethod · 0.45
set_transformMethod · 0.45
get_clip_pathMethod · 0.45
set_clip_pathMethod · 0.45

Tested by

no test coverage detected