Skip to content

Correct and improve documentation for anchored artists #23864

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 1 commit into from
Sep 11, 2022
Merged
Show file tree
Hide file tree
Changes from all 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
12 changes: 6 additions & 6 deletions lib/mpl_toolkits/axes_grid1/anchored_artists.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ def __init__(self, width, height, xdescent, ydescent,
Parameters
----------
width, height : float
width and height of the container, in pixels.
Width and height of the container, in pixels.
xdescent, ydescent : float
descent of the container in the x- and y- direction, in pixels.
Descent of the container in the x- and y- direction, in pixels.
loc : str
Location of this artist. Valid locations are
'upper left', 'upper center', 'upper right',
Expand Down Expand Up @@ -141,7 +141,7 @@ def __init__(self, transform, width, height, angle, loc,
angle : float
Rotation of the ellipse, in degrees, anti-clockwise.
loc : str
Location of this ellipse. Valid locations are
Location of the ellipse. Valid locations are
'upper left', 'upper center', 'upper right',
'center left', 'center', 'center right',
'lower left', 'lower center, 'lower right'.
Expand Down Expand Up @@ -191,7 +191,7 @@ def __init__(self, transform, size, label, loc,
label : str
Label to display.
loc : str
Location of this ellipse. Valid locations are
Location of the size bar. Valid locations are
'upper left', 'upper center', 'upper right',
'center left', 'center', 'center right',
'lower left', 'lower center, 'lower right'.
Expand All @@ -216,7 +216,7 @@ def __init__(self, transform, size, label, loc,
fontproperties : `matplotlib.font_manager.FontProperties`, optional
Font properties for the label text.
fill_bar : bool, optional
If True and if size_vertical is nonzero, the size bar will
If True and if *size_vertical* is nonzero, the size bar will
be filled in with the color specified by the size bar.
Defaults to True if *size_vertical* is greater than
zero and False otherwise.
Expand Down Expand Up @@ -311,7 +311,7 @@ def __init__(self, transform, label_x, label_y, length=0.15,
fontsize : float, default: 0.08
Size of label strings, given in coordinates of *transform*.
loc : str, default: 'upper left'
Location of this ellipse. Valid locations are
Location of the arrow. Valid locations are
'upper left', 'upper center', 'upper right',
'center left', 'center', 'center right',
'lower left', 'lower center, 'lower right'.
Expand Down
22 changes: 12 additions & 10 deletions tutorials/text/annotations.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,10 @@
# artists) is known in pixel size during the time of creation. For
# example, If you want to draw a circle with fixed size of 20 pixel x 20
# pixel (radius = 10 pixel), you can utilize
# ``AnchoredDrawingArea``. The instance is created with a size of the
# drawing area (in pixels), and arbitrary artists can added to the
# drawing area. Note that the extents of the artists that are added to
# the drawing area are not related to the placement of the drawing
# `~mpl_toolkits.axes_grid1.anchored_artists.AnchoredDrawingArea`. The instance
# is created with a size of the drawing area (in pixels), and arbitrary artists
# can added to the drawing area. Note that the extents of the artists that are
# added to the drawing area are not related to the placement of the drawing
# area itself. Only the initial size matters.
#
# The artists that are added to the drawing area should not have a
Expand All @@ -330,9 +330,11 @@
###############################################################################
# Sometimes, you want your artists to scale with the data coordinate (or
# coordinates other than canvas pixels). You can use
# ``AnchoredAuxTransformBox`` class. This is similar to
# ``AnchoredDrawingArea`` except that the extent of the artist is
# determined during the drawing time respecting the specified transform.
# `~mpl_toolkits.axes_grid1.anchored_artists.AnchoredAuxTransformBox` class.
# This is similar to
# `~mpl_toolkits.axes_grid1.anchored_artists.AnchoredDrawingArea` except that
# the extent of the artist is determined during the drawing time respecting the
# specified transform.
#
# The ellipse in the example below will have width and height
# corresponding to 0.1 and 0.4 in data coordinates and will be
Expand Down Expand Up @@ -441,7 +443,7 @@
# ~~~~~~~~~~~~~~~~~~~~~
#
# `.ConnectionPatch` is like an annotation without text. While `~.Axes.annotate`
# is sufficient in most situations, ``ConnectionPatch`` is useful when you want to
# is sufficient in most situations, `.ConnectionPatch` is useful when you want to
# connect points in different axes. ::
#
# from matplotlib.patches import ConnectionPatch
Expand All @@ -457,7 +459,7 @@
# :target: ../../gallery/userdemo/connect_simple01.html
# :align: center
#
# Here, we added the ``ConnectionPatch`` to the *figure* (with `~.Figure.add_artist`)
# Here, we added the `.ConnectionPatch` to the *figure* (with `~.Figure.add_artist`)
# rather than to either axes: this ensures that it is drawn on top of both axes,
# and is also necessary if using :doc:`constrained_layout
# </tutorials/intermediate/constrainedlayout_guide>` for positioning the axes.
Expand All @@ -468,7 +470,7 @@
# Zoom effect between Axes
# ~~~~~~~~~~~~~~~~~~~~~~~~
#
# ``mpl_toolkits.axes_grid1.inset_locator`` defines some patch classes useful for
# `mpl_toolkits.axes_grid1.inset_locator` defines some patch classes useful for
# interconnecting two axes. Understanding the code requires some knowledge of
# Matplotlib's transform system.
#
Expand Down