From 73b60f78bb5aff916a24aad8c6b1c4d3e78dbb09 Mon Sep 17 00:00:00 2001 From: Francisco Cardozo Date: Tue, 5 Nov 2024 11:45:12 -0500 Subject: [PATCH 1/4] contribution to strint issue in artist.py --- galleries/tutorials/artists.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/galleries/tutorials/artists.py b/galleries/tutorials/artists.py index f5e4589e8a52..de0afc7a49e1 100644 --- a/galleries/tutorials/artists.py +++ b/galleries/tutorials/artists.py @@ -156,8 +156,8 @@ 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 -# ` and :attr:`Axes.patch +# 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 @@ -331,7 +331,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 +# setting the ``Artist`` transform to :attr:`!fig.transFigure # `: import matplotlib.lines as lines @@ -408,7 +408,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 +# add the patches to the :attr:`!Axes.patches # ` list: # # .. sourcecode:: ipython @@ -556,8 +556,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 From 9ff5a5f8d1e89c18651f906e9452a91a4f8f9e58 Mon Sep 17 00:00:00 2001 From: Francisco Cardozo Date: Tue, 5 Nov 2024 11:59:12 -0500 Subject: [PATCH 2/4] Added casses I missed to fix --- galleries/tutorials/artists.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/galleries/tutorials/artists.py b/galleries/tutorials/artists.py index de0afc7a49e1..c2fe7904da44 100644 --- a/galleries/tutorials/artists.py +++ b/galleries/tutorials/artists.py @@ -284,7 +284,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 `. 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 @@ -375,7 +375,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:: From 5b39a8e44a9f33b4b40dcab863b35c65e80da591 Mon Sep 17 00:00:00 2001 From: Francisco Cardozo Date: Wed, 6 Nov 2024 12:52:21 -0500 Subject: [PATCH 3/4] remove explicit targets and ~ --- galleries/tutorials/artists.py | 34 +++++++++++++++------------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/galleries/tutorials/artists.py b/galleries/tutorials/artists.py index c2fe7904da44..00c565a531ba 100644 --- a/galleries/tutorials/artists.py +++ b/galleries/tutorials/artists.py @@ -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 + 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 `_ 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 -# ` 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 +# 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 `. 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 -# `: +# 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 -# ` 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 From 249118151366f4370be145c40a5fb633183cf958 Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Thu, 14 Nov 2024 11:24:41 +0100 Subject: [PATCH 4/4] Fix trailing whitespace. --- galleries/tutorials/artists.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/galleries/tutorials/artists.py b/galleries/tutorials/artists.py index 00c565a531ba..a258eb71d447 100644 --- a/galleries/tutorials/artists.py +++ b/galleries/tutorials/artists.py @@ -157,8 +157,8 @@ class in the Matplotlib API, and the one you will be working with most # 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` 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). +# ("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 # # ========== =================================================================