Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Updates thegalleries/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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
timhoffm merged 4 commits intomatplotlib:mainfromfocardozom:main
Nov 14, 2024
Merged
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 15 additions & 19 deletionsgalleries/tutorials/artists.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -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
Copy link
Member

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 ofFigureCanvas that's realized through the subclasses ofFigureCanvasBase. Maybe

Suggested change
*the:class:`!matplotlib.backend_bases.FigureCanvas`istheareaontowhich
*the*FigureCanvas* (subclassesof`.FigureCanvasBase`)istheareaontowhich

And 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.

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Same issue as above:Renderer is a concept realized through the subclasses ofRendererBase.

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
Expand DownExpand Up@@ -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
Expand DownExpand Up@@ -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
Expand DownExpand Up@@ -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

Expand DownExpand Up@@ -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::
Expand DownExpand Up@@ -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
#
Expand DownExpand Up@@ -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
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp