Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2df11cc

Browse files
authored
Merge pull request #22249 from timhoffm/doc-Axes
DOC: More capitalization of Axes
2 parents f1a1268 + 162bd59 commit 2df11cc

32 files changed

+70
-70
lines changed

examples/axes_grid1/demo_colorbar_with_axes_divider.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818

1919
im1 = ax1.imshow([[1, 2], [3, 4]])
2020
ax1_divider = make_axes_locatable(ax1)
21-
# Add an axes to the right of the main axes.
21+
# Add an Axes to the right of the main Axes.
2222
cax1 = ax1_divider.append_axes("right", size="7%", pad="2%")
2323
cb1 = fig.colorbar(im1, cax=cax1)
2424

2525
im2 = ax2.imshow([[1, 2], [3, 4]])
2626
ax2_divider = make_axes_locatable(ax2)
27-
# Add an axes above the main axes.
27+
# Add an Axes above the main Axes.
2828
cax2 = ax2_divider.append_axes("top", size="7%", pad="2%")
2929
cb2 = fig.colorbar(im2, cax=cax2, orientation="horizontal")
3030
# Change tick position to top (with the default tick position "bottom", ticks

examples/axes_grid1/simple_axes_divider1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212

1313
def label_axes(ax, text):
14-
"""Place a label at the center of an axes, and remove the axis ticks."""
14+
"""Place a label at the center of an Axes, and remove the axis ticks."""
1515
ax.text(.5, .5, text, transform=ax.transAxes,
1616
horizontalalignment="center", verticalalignment="center")
1717
ax.tick_params(bottom=False, labelbottom=False,

examples/axes_grid1/simple_colorbar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
ax = plt.subplot()
1212
im = ax.imshow(np.arange(100).reshape((10, 10)))
1313

14-
# create an axes on the right side of ax. The width of cax will be 5%
14+
# create an Axes on the right side of ax. The width of cax will be 5%
1515
# of ax and the padding between cax and ax will be fixed at 0.05 inch.
1616
divider = make_axes_locatable(ax)
1717
cax = divider.append_axes("right", size="5%", pad=0.05)

examples/lines_bars_and_markers/fill_between_alpha.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133

134134
###############################################################################
135135
# Another handy use of filled regions is to highlight horizontal or vertical
136-
# spans of an axes -- for that Matplotlib has the helper functions
136+
# spans of an Axes -- for that Matplotlib has the helper functions
137137
# `~matplotlib.axes.Axes.axhspan` and `~matplotlib.axes.Axes.axvspan`. See
138138
# :doc:`/gallery/subplots_axes_and_figures/axhspan_demo`.
139139

examples/lines_bars_and_markers/gradient_bar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
by a unit vector *v*. The values at the corners are then obtained by the
1313
lengths of the projections of the corner vectors on *v*.
1414
15-
A similar approach can be used to create a gradient background for an axes.
15+
A similar approach can be used to create a gradient background for an Axes.
1616
In that case, it is helpful to uses Axes coordinates (``extent=(0, 1, 0, 1),
1717
transform=ax.transAxes``) to be independent of the data coordinates.
1818

examples/misc/logos2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def create_icon_axes(fig, ax_position, lw_bars, lw_grid, lw_border, rgrid):
8989

9090

9191
def create_text_axes(fig, height_px):
92-
"""Create an axes in *fig* that contains 'matplotlib' as Text."""
92+
"""Create an Axes in *fig* that contains 'matplotlib' as Text."""
9393
ax = fig.add_axes((0, 0, 1, 1))
9494
ax.set_aspect("equal")
9595
ax.set_axis_off()

examples/spines/spines.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
66
This demo compares:
77
8-
- normal axes, with spines on all four sides;
9-
- an axes with spines only on the left and bottom;
10-
- an axes using custom bounds to limit the extent of the spine.
8+
- normal Axes, with spines on all four sides;
9+
- an Axes with spines only on the left and bottom;
10+
- an Axes using custom bounds to limit the extent of the spine.
1111
"""
1212
import numpy as np
1313
import matplotlib.pyplot as plt

examples/subplots_axes_and_figures/axes_box_aspect.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Axes box aspect
44
===============
55
6-
This demo shows how to set the aspect of an axes box directly via
6+
This demo shows how to set the aspect of an Axes box directly via
77
`~.Axes.set_box_aspect`. The box aspect is the ratio between axes height
88
and axes width in physical units, independent of the data limits.
99
This is useful to e.g. produce a square plot, independent of the data it
@@ -119,7 +119,7 @@
119119
# ~~~~~~~~~~~~~~~~~~~~~~~~~~
120120
#
121121
# When setting the box aspect, one may still set the data aspect as well.
122-
# Here we create an axes with a box twice as long as tall and use an "equal"
122+
# Here we create an Axes with a box twice as long as tall and use an "equal"
123123
# data aspect for its contents, i.e. the circle actually stays circular.
124124

125125
fig6, ax = plt.subplots()
@@ -135,8 +135,8 @@
135135
# Box aspect for many subplots
136136
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
137137
#
138-
# It is possible to pass the box aspect to an axes at initialization. The
139-
# following creates a 2 by 3 subplot grid with all square axes.
138+
# It is possible to pass the box aspect to an Axes at initialization. The
139+
# following creates a 2 by 3 subplot grid with all square Axes.
140140

141141
fig7, axs = plt.subplots(2, 3, subplot_kw=dict(box_aspect=1),
142142
sharex=True, sharey=True, constrained_layout=True)

examples/subplots_axes_and_figures/shared_axis_demo.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
===========
55
66
You can share the x or y axis limits for one axis with another by
7-
passing an axes instance as a *sharex* or *sharey* keyword argument.
7+
passing an `~.axes.Axes` instance as a *sharex* or *sharey* keyword argument.
88
99
Changing the axis limits on one axes will be reflected automatically
1010
in the other, and vice-versa, so when you navigate with the toolbar
11-
the axes will follow each other on their shared axes. Ditto for
11+
the Axes will follow each other on their shared axis. Ditto for
1212
changes in the axis scaling (e.g., log vs. linear). However, it is
1313
possible to have differences in tick labeling, e.g., you can selectively
14-
turn off the tick labels on one axes.
14+
turn off the tick labels on one Axes.
1515
1616
The example below shows how to customize the tick labels on the
1717
various axes. Shared axes share the tick locator, tick formatter,
@@ -20,13 +20,13 @@
2020
because you may want to make the tick labels smaller on the upper
2121
axes, e.g., in the example below.
2222
23-
If you want to turn off the ticklabels for a given axes (e.g., on
23+
If you want to turn off the ticklabels for a given Axes (e.g., on
2424
subplot(211) or subplot(212), you cannot do the standard trick::
2525
2626
setp(ax2, xticklabels=[])
2727
2828
because this changes the tick Formatter, which is shared among all
29-
axes. But you can alter the visibility of the labels, which is a
29+
Axes. But you can alter the visibility of the labels, which is a
3030
property::
3131
3232
setp(ax2.get_xticklabels(), visible=False)

lib/matplotlib/_constrained_layout.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
often just set to 1 for an equal grid.
3535
3636
Subplotspecs that are derived from this gridspec can contain either a
37-
``SubPanel``, a ``GridSpecFromSubplotSpec``, or an axes. The ``SubPanel`` and
38-
``GridSpecFromSubplotSpec`` are dealt with recursively and each contain an
37+
``SubPanel``, a ``GridSpecFromSubplotSpec``, or an ``Axes``. The ``SubPanel``
38+
and ``GridSpecFromSubplotSpec`` are dealt with recursively and each contain an
3939
analogous layout.
4040
4141
Each ``GridSpec`` has a ``_layoutgrid`` attached to it. The ``_layoutgrid``

lib/matplotlib/artist.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def __init__(self):
185185
def __getstate__(self):
186186
d = self.__dict__.copy()
187187
# remove the unpicklable remove method, this will get re-added on load
188-
# (by the axes) if the artist lives on an axes.
188+
# (by the Axes) if the artist lives on an Axes.
189189
d['stale_callback'] = None
190190
return d
191191

@@ -516,7 +516,7 @@ def pick(self, mouseevent):
516516
if (mouseevent.inaxes is None or ax is None
517517
or mouseevent.inaxes == ax):
518518
# we need to check if mouseevent.inaxes is None
519-
# because some objects associated with an axes (e.g., a
519+
# because some objects associated with an Axes (e.g., a
520520
# tick label) can be outside the bounding box of the
521521
# axes and inaxes will be None
522522
# also check that ax is None so that it traverse objects

lib/matplotlib/backend_bases.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2491,7 +2491,7 @@ def key_press_handler(event, canvas=None, toolbar=None):
24912491
back-compatibility, but, if set, should always be equal to
24922492
``event.canvas.toolbar``.
24932493
"""
2494-
# these bindings happen whether you are over an axes or not
2494+
# these bindings happen whether you are over an Axes or not
24952495

24962496
if event.key is None:
24972497
return
@@ -2554,7 +2554,7 @@ def key_press_handler(event, canvas=None, toolbar=None):
25542554
if event.inaxes is None:
25552555
return
25562556

2557-
# these bindings require the mouse to be over an axes to trigger
2557+
# these bindings require the mouse to be over an Axes to trigger
25582558
def _get_uniform_gridstate(ticks):
25592559
# Return True/False if all grid lines are on or off, None if they are
25602560
# not all in the same state.

lib/matplotlib/figure.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ class FigureBase(Artist):
188188
def __init__(self, **kwargs):
189189
super().__init__()
190190
# remove the non-figure artist _axes property
191-
# as it makes no sense for a figure to be _in_ an axes
191+
# as it makes no sense for a figure to be _in_ an Axes
192192
# this is used by the property methods in the artist base class
193193
# which are over-ridden in this class
194194
del self._axes
@@ -1879,7 +1879,7 @@ def _do_layout(gs, mosaic, unique_ids, nested):
18791879
name, arg, method = this_level[key]
18801880
# we are doing some hokey function dispatch here based
18811881
# on the 'method' string stashed above to sort out if this
1882-
# element is an axes or a nested mosaic.
1882+
# element is an Axes or a nested mosaic.
18831883
if method == 'axes':
18841884
slc = arg
18851885
# add a single axes

lib/matplotlib/projections/polar.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@ def set_thetalim(self, *args, **kwargs):
10241024
where minval and maxval are the minimum and maximum limits. Values are
10251025
wrapped in to the range :math:`[0, 2\pi]` (in radians), so for example
10261026
it is possible to do ``set_thetalim(-np.pi / 2, np.pi / 2)`` to have
1027-
an axes symmetric around 0. A ValueError is raised if the absolute
1027+
an axis symmetric around 0. A ValueError is raised if the absolute
10281028
angle difference is larger than a full circle.
10291029
"""
10301030
orig_lim = self.get_xlim() # in radians

lib/matplotlib/pyplot.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
pyplot is still usually used to create the figure and often the axes in the
2121
figure. See `.pyplot.figure`, `.pyplot.subplots`, and
2222
`.pyplot.subplot_mosaic` to create figures, and
23-
:doc:`Axes API <../axes_api>` for the plotting methods on an axes::
23+
:doc:`Axes API <../axes_api>` for the plotting methods on an Axes::
2424
2525
import numpy as np
2626
import matplotlib.pyplot as plt
@@ -979,7 +979,7 @@ def figlegend(*args, **kwargs):
979979
@docstring.dedent_interpd
980980
def axes(arg=None, **kwargs):
981981
"""
982-
Add an axes to the current figure and make it the current axes.
982+
Add an Axes to the current figure and make it the current Axes.
983983
984984
Call signatures::
985985
@@ -992,10 +992,10 @@ def axes(arg=None, **kwargs):
992992
arg : None or 4-tuple
993993
The exact behavior of this function depends on the type:
994994
995-
- *None*: A new full window axes is added using
995+
- *None*: A new full window Axes is added using
996996
``subplot(**kwargs)``.
997997
- 4-tuple of floats *rect* = ``[left, bottom, width, height]``.
998-
A new axes is added with dimensions *rect* in normalized
998+
A new Axes is added with dimensions *rect* in normalized
999999
(0, 1) units using `~.Figure.add_axes` on the current figure.
10001000
10011001
projection : {None, 'aitoff', 'hammer', 'lambert', 'mollweide', \
@@ -1010,10 +1010,10 @@ def axes(arg=None, **kwargs):
10101010
sharex, sharey : `~.axes.Axes`, optional
10111011
Share the x or y `~matplotlib.axis` with sharex and/or sharey.
10121012
The axis will have the same limits, ticks, and scale as the axis
1013-
of the shared axes.
1013+
of the shared Axes.
10141014
10151015
label : str
1016-
A label for the returned axes.
1016+
A label for the returned Axes.
10171017
10181018
Returns
10191019
-------
@@ -1026,23 +1026,23 @@ def axes(arg=None, **kwargs):
10261026
----------------
10271027
**kwargs
10281028
This method also takes the keyword arguments for
1029-
the returned axes class. The keyword arguments for the
1030-
rectilinear axes class `~.axes.Axes` can be found in
1029+
the returned Axes class. The keyword arguments for the
1030+
rectilinear Axes class `~.axes.Axes` can be found in
10311031
the following table but there might also be other keyword
1032-
arguments if another projection is used, see the actual axes
1032+
arguments if another projection is used, see the actual Axes
10331033
class.
10341034
10351035
%(Axes:kwdoc)s
10361036
10371037
Notes
10381038
-----
1039-
If the figure already has a axes with key (*args*,
1039+
If the figure already has an Axes with key (*args*,
10401040
*kwargs*) then it will simply make that axes current and
10411041
return it. This behavior is deprecated. Meanwhile, if you do
10421042
not want this behavior (i.e., you want to force the creation of a
1043-
new axes), you must use a unique set of args and kwargs. The axes
1043+
new axes), you must use a unique set of args and kwargs. The Axes
10441044
*label* attribute has been exposed for this purpose: if you want
1045-
two axes that are otherwise identical to be added to the figure,
1045+
two Axes that are otherwise identical to be added to the figure,
10461046
make sure you give them unique labels.
10471047
10481048
See Also
@@ -1057,11 +1057,11 @@ def axes(arg=None, **kwargs):
10571057
--------
10581058
::
10591059
1060-
# Creating a new full window axes
1060+
# Creating a new full window Axes
10611061
plt.axes()
10621062
1063-
# Creating a new axes with specified dimensions and some kwargs
1064-
plt.axes((left, bottom, width, height), facecolor='w')
1063+
# Creating a new Axes with specified dimensions and a grey background
1064+
plt.axes((left, bottom, width, height), facecolor='grey')
10651065
"""
10661066
fig = gcf()
10671067
pos = kwargs.pop('position', None)
@@ -1273,7 +1273,7 @@ def subplot(*args, **kwargs):
12731273
key = SubplotSpec._from_subplot_args(fig, args)
12741274

12751275
for ax in fig.axes:
1276-
# if we found an axes at the position sort out if we can re-use it
1276+
# if we found an Axes at the position sort out if we can re-use it
12771277
if hasattr(ax, 'get_subplotspec') and ax.get_subplotspec() == key:
12781278
# if the user passed no kwargs, re-use
12791279
if kwargs == {}:

lib/matplotlib/tests/test_axes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -529,8 +529,8 @@ def test_use_sticky_edges():
529529

530530
@check_figures_equal(extensions=["png"])
531531
def test_sticky_shared_axes(fig_test, fig_ref):
532-
# Check that sticky edges work whether they are set in an axes that is a
533-
# "leader" in a share, or an axes that is a "follower".
532+
# Check that sticky edges work whether they are set in an Axes that is a
533+
# "leader" in a share, or an Axes that is a "follower".
534534
Z = np.arange(15).reshape(3, 5)
535535

536536
ax0 = fig_test.add_subplot(211)
@@ -6151,7 +6151,7 @@ def test_title_above_offset(left, center):
61516151

61526152

61536153
def test_title_no_move_off_page():
6154-
# If an axes is off the figure (ie. if it is cropped during a save)
6154+
# If an Axes is off the figure (ie. if it is cropped during a save)
61556155
# make sure that the automatic title repositioning does not get done.
61566156
mpl.rcParams['axes.titley'] = None
61576157
fig = plt.figure()

lib/matplotlib/tests/test_constrainedlayout.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ def test_colorbar_location():
423423

424424

425425
def test_hidden_axes():
426-
# test that if we make an axes not visible that constrained_layout
426+
# test that if we make an Axes not visible that constrained_layout
427427
# still works. Note the axes still takes space in the layout
428428
# (as does a gridspec slot that is empty)
429429
fig, axs = plt.subplots(2, 2, layout="constrained")

lib/matplotlib/tests/test_patches.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def test_rotate_rect_draw(fig_test, fig_ref):
138138
ax_ref.add_patch(rect_ref)
139139
assert rect_ref.get_angle() == angle
140140

141-
# Check that when the angle is updated after adding to an axes, that the
141+
# Check that when the angle is updated after adding to an Axes, that the
142142
# patch is marked stale and redrawn in the correct location
143143
rect_test = Rectangle(loc, width, height)
144144
assert rect_test.get_angle() == 0

lib/matplotlib/tests/test_pyplot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def test_gca_kwargs():
254254
assert ax1.name == 'polar'
255255
plt.close()
256256

257-
# plt.gca() ignores keyword arguments if an axes already exists.
257+
# plt.gca() ignores keyword arguments if an Axes already exists.
258258
plt.figure()
259259
ax = plt.gca()
260260
with pytest.warns(
@@ -268,7 +268,7 @@ def test_gca_kwargs():
268268

269269

270270
def test_subplot_projection_reuse():
271-
# create an axes
271+
# create an Axes
272272
ax1 = plt.subplot(111)
273273
# check that it is current
274274
assert ax1 is plt.gca()

lib/matplotlib/tests/test_widgets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1426,7 +1426,7 @@ def test_MultiCursor(horizOn, vertOn):
14261426
for l in multi.hlines:
14271427
assert l.get_ydata() == (.25, .25)
14281428

1429-
# test a move event in an axes not part of the MultiCursor
1429+
# test a move event in an Axes not part of the MultiCursor
14301430
# the lines in ax1 and ax2 should not have moved.
14311431
event = mock_event(ax3, xdata=.75, ydata=.75)
14321432
multi.onmove(event)

lib/matplotlib/transforms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1411,7 +1411,7 @@ def contains_branch_seperately(self, other_transform):
14111411
each separate dimension.
14121412
14131413
A common use for this method is to identify if a transform is a blended
1414-
transform containing an axes' data transform. e.g.::
1414+
transform containing an Axes' data transform. e.g.::
14151415
14161416
x_isdata, y_isdata = trans.contains_branch_seperately(ax.transData)
14171417

lib/matplotlib/tri/tricontour.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def __init__(self, ax, *args, **kwargs):
2222
depending on whether keyword arg 'filled' is False
2323
(default) or True.
2424
25-
The first argument of the initializer must be an axes
25+
The first argument of the initializer must be an `~.axes.Axes`
2626
object. The remaining arguments and keyword arguments
2727
are described in the docstring of `~.Axes.tricontour`.
2828
"""

0 commit comments

Comments
 (0)