@@ -314,24 +314,26 @@ class in the Matplotlib API, and the one you will be working with most
314314#
315315#
316316# The figure also has its own ``images``, ``lines``, ``patches`` and ``text``
317- # attributes, which you can use to add primitives directly. When doing so, the
318- # default coordinate system for the ``Figure`` will simply be in pixels (which
319- # is not usually what you want). If you instead use Figure-level methods to add
320- # Artists (e.g., using `.Figure.text` to add text), then the default coordinate
321- # system will be "figure coordinates" where (0, 0) is the bottom-left of the
322- # figure and (1, 1) is the top-right of the figure.
323- #
324- # As with all ``Artist``\s, you can control this coordinate system by setting
325- # the transform property. You can explicitly use "figure coordinates" by
326- # setting the ``Artist`` transform to :attr:`!fig.transFigure`:
317+ # attributes, which you can use to access any primitives that are its direct
318+ # children. Adding images and text is usually achieved with the
319+ # `~.Figure.figimage` and `~.Figure.text` methods. Other artists may be added
320+ # with the `~.Figure.add_artist` method.
321+ #
322+ # As with all ``Artist``\s, you can control the coordinate system by setting
323+ # the transform property (see :ref:`transforms_tutorial`). When using
324+ # `~.Figure.figimage`, the default coordinate system is simply pixels. When
325+ # using `~.Figure.text` or `~.Figure.add_artist`, the default coordinate system
326+ # will be "figure coordinates" where (0, 0) is the bottom-left of the figure
327+ # and (1, 1) is the top-right of the figure.
327328
328329import matplotlib .lines as lines
329330
330331fig = plt .figure ()
331332
332- l1 = lines .Line2D ([0 , 1 ], [0 , 1 ], transform = fig .transFigure , figure = fig )
333- l2 = lines .Line2D ([0 , 1 ], [1 , 0 ], transform = fig .transFigure , figure = fig )
334- fig .lines .extend ([l1 , l2 ])
333+ line1 = lines .Line2D ([0 , 1 ], [0 , 1 ])
334+ line2 = lines .Line2D ([0 , 1 ], [1 , 0 ])
335+ for line in line1 , line2 :
336+ fig .add_artist (line )
335337
336338plt .show ()
337339
@@ -342,16 +344,18 @@ class in the Matplotlib API, and the one you will be working with most
342344# Figure attribute Description
343345# ================ ============================================================
344346# axes A list of `~.axes.Axes` instances
347+ # subfigures A list of `.SubFigure` instances
345348# patch The `.Rectangle` background
346- # images A list of `.FigureImage` patches -
349+ # images An `~.artist.ArtistList` of `.FigureImage` patches -
347350# useful for raw pixel display
348- # legends A list of Figure `.Legend` instances
351+ # legends An `~.artist.ArtistList` of Figure `.Legend` instances
349352# (different from ``Axes.get_legend()``)
350- # lines A list of Figure `.Line2D` instances
353+ # lines An `~.artist.ArtistList` of Figure `.Line2D` instances
351354# (rarely used, see ``Axes.lines``)
352- # patches A list of Figure `.Patch`\s
355+ # patches An `~.artist.ArtistList` of Figure `.Patch`\s
353356# (rarely used, see ``Axes.patches``)
354- # texts A list Figure `.Text` instances
357+ # texts An `~.artist.ArtistList` of Figure `.Text` instances
358+ # artists An `~.artist.ArtistList` of all other `.Artist` instances
355359# ================ ============================================================
356360#
357361# .. _axes-container:
@@ -562,13 +566,13 @@ class in the Matplotlib API, and the one you will be working with most
562566# ============== =========================================
563567# Axes attribute Description
564568# ============== =========================================
565- # artists An `.ArtistList` of `.Artist` instances
569+ # artists An `~.artist .ArtistList` of `.Artist` instances
566570# patch `.Rectangle` instance for Axes background
567- # collections An `.ArtistList` of `.Collection` instances
568- # images An `.ArtistList` of `.AxesImage`
569- # lines An `.ArtistList` of `.Line2D` instances
570- # patches An `.ArtistList` of `.Patch` instances
571- # texts An `.ArtistList` of `.Text` instances
571+ # collections An `~.artist .ArtistList` of `.Collection` instances
572+ # images An `~.artist .ArtistList` of `.AxesImage`
573+ # lines An `~.artist .ArtistList` of `.Line2D` instances
574+ # patches An `~.artist .ArtistList` of `.Patch` instances
575+ # texts An `~.artist .ArtistList` of `.Text` instances
572576# xaxis A `matplotlib.axis.XAxis` instance
573577# yaxis A `matplotlib.axis.YAxis` instance
574578# ============== =========================================
0 commit comments