-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Updates the galleries/tutorials/artists.py
file in response to issue #28920
#29080
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,15 +11,15 @@ | |
|
||
There are three layers to the Matplotlib API. | ||
|
||
* the :class:`matplotlib.backend_bases.FigureCanvas` is the area onto which | ||
* the :class:`!matplotlib.backend_bases.FigureCanvas` is the area onto which | ||
the figure is drawn | ||
* the :class:`matplotlib.backend_bases.Renderer` is the object which knows how | ||
to draw on the :class:`~matplotlib.backend_bases.FigureCanvas` | ||
* the :class:`!matplotlib.backend_bases.Renderer` is the object which knows how | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same issue as above: Renderer is a concept realized through the subclasses of |
||
to draw on the :class:`!matplotlib.backend_bases.FigureCanvas` | ||
* and the :class:`matplotlib.artist.Artist` is the object that knows how to use | ||
a renderer to paint onto the canvas. | ||
|
||
The :class:`~matplotlib.backend_bases.FigureCanvas` and | ||
:class:`~matplotlib.backend_bases.Renderer` handle all the details of | ||
The :class:`!matplotlib.backend_bases.FigureCanvas` and | ||
:class:`!matplotlib.backend_bases.Renderer` handle all the details of | ||
talking to user interface toolkits like `wxPython | ||
<https://www.wxpython.org>`_ or drawing languages like PostScript®, and | ||
the ``Artist`` handles all the high level constructs like representing | ||
|
@@ -156,12 +156,10 @@ class in the Matplotlib API, and the one you will be working with most | |
# (the standard white box with black edges in the typical Matplotlib | ||
# plot, has a ``Rectangle`` instance that determines the color, | ||
# transparency, and other properties of the Axes. These instances are | ||
# stored as member variables :attr:`Figure.patch | ||
# <matplotlib.figure.Figure.patch>` and :attr:`Axes.patch | ||
# <matplotlib.axes.Axes.patch>` ("Patch" is a name inherited from | ||
# MATLAB, and is a 2D "patch" of color on the figure, e.g., rectangles, | ||
# circles and polygons). Every Matplotlib ``Artist`` has the following | ||
# properties | ||
# stored as member variables :attr:`!Figure.patch` and :attr:`!Axes.patch` | ||
# ("Patch" is a name inherited from MATLAB, and is a 2D "patch" | ||
# of color on the figure, e.g., rectangles, circles and polygons). | ||
# Every Matplotlib ``Artist`` has the following properties | ||
# | ||
# ========== ================================================================= | ||
# Property Description | ||
|
@@ -284,7 +282,7 @@ class in the Matplotlib API, and the one you will be working with most | |
# :class:`matplotlib.figure.Figure`, and it contains everything in the | ||
# figure. The background of the figure is a | ||
# :class:`~matplotlib.patches.Rectangle` which is stored in | ||
# :attr:`Figure.patch <matplotlib.figure.Figure.patch>`. As | ||
# :attr:`!Figure.patch`. As | ||
# you add subplots (:meth:`~matplotlib.figure.Figure.add_subplot`) and | ||
# Axes (:meth:`~matplotlib.figure.Figure.add_axes`) to the figure | ||
# these will be appended to the :attr:`Figure.axes | ||
|
@@ -331,8 +329,7 @@ class in the Matplotlib API, and the one you will be working with most | |
# | ||
# As with all ``Artist``\s, you can control this coordinate system by setting | ||
# the transform property. You can explicitly use "figure coordinates" by | ||
# setting the ``Artist`` transform to :attr:`fig.transFigure | ||
# <matplotlib.figure.Figure.transFigure>`: | ||
# setting the ``Artist`` transform to :attr:`!fig.transFigure`: | ||
|
||
import matplotlib.lines as lines | ||
|
||
|
@@ -375,7 +372,7 @@ class in the Matplotlib API, and the one you will be working with most | |
# customize the ``Artists`` it contains. Like the | ||
# :class:`~matplotlib.figure.Figure`, it contains a | ||
# :class:`~matplotlib.patches.Patch` | ||
# :attr:`~matplotlib.axes.Axes.patch` which is a | ||
# :attr:`!matplotlib.axes.Axes.patch` which is a | ||
# :class:`~matplotlib.patches.Rectangle` for Cartesian coordinates and a | ||
# :class:`~matplotlib.patches.Circle` for polar coordinates; this patch | ||
# determines the shape, background and border of the plotting region:: | ||
|
@@ -408,8 +405,7 @@ class in the Matplotlib API, and the one you will be working with most | |
# | ||
# Similarly, methods that create patches, like | ||
# :meth:`~matplotlib.axes.Axes.bar` creates a list of rectangles, will | ||
# add the patches to the :attr:`Axes.patches | ||
# <matplotlib.axes.Axes.patches>` list: | ||
# add the patches to the :attr:`!Axes.patches` list: | ||
# | ||
# .. sourcecode:: ipython | ||
# | ||
|
@@ -556,8 +552,8 @@ class in the Matplotlib API, and the one you will be working with most | |
# important ``Artist`` containers: the :class:`~matplotlib.axis.XAxis` | ||
# and :class:`~matplotlib.axis.YAxis`, which handle the drawing of the | ||
# ticks and labels. These are stored as instance variables | ||
# :attr:`~matplotlib.axes.Axes.xaxis` and | ||
# :attr:`~matplotlib.axes.Axes.yaxis`. The ``XAxis`` and ``YAxis`` | ||
# :attr:`!matplotlib.axes.Axes.xaxis` and | ||
# :attr:`!matplotlib.axes.Axes.yaxis`. The ``XAxis`` and ``YAxis`` | ||
# containers will be detailed below, but note that the ``Axes`` contains | ||
# many helper methods which forward calls on to the | ||
# :class:`~matplotlib.axis.Axis` instances, so you often do not need to | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, the previous way of expression is not exactly great - there is just no class
matplotlib.backend_bases.FigureCanvas
. We have a logical concept of FigureCanvas that's realized through the subclasses ofFigureCanvasBase
. MaybeAnd subsequently only use FigureCanvas as a given name (for the logical concept) without further highlighting.
Or better, switch to
:term:`FigureCanvas`
, but that'd require first setting up a gloassary #28889.But we can also leave all this for later.