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

Skip to content

Commit 1a525a7

Browse files
authored
Merge pull request #14231 from meeseeksmachine/auto-backport-of-pr-14228-on-v3.1.x
Backport PR #14228 on branch v3.1.x (DOC: fix parameters line in Axes.axis docstring)
2 parents 41a8d62 + 330f4b4 commit 1a525a7

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

lib/matplotlib/axes/_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1607,7 +1607,7 @@ def axis(self, *args, **kwargs):
16071607
16081608
Parameters
16091609
----------
1610-
xmin, ymin, xmax, ymax : float, optional
1610+
xmin, xmax, ymin, ymax : float, optional
16111611
The axis limits to be set. Either none or all of the limits must
16121612
be given.
16131613

lib/matplotlib/tests/test_axes.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6335,6 +6335,22 @@ def test_axis_bool_arguments(fig_test, fig_ref):
63356335
fig_ref.add_subplot(212).axis("on")
63366336

63376337

6338+
def test_axis_extent_arg():
6339+
fig, ax = plt.subplots()
6340+
xmin = 5
6341+
xmax = 10
6342+
ymin = 15
6343+
ymax = 20
6344+
extent = ax.axis([xmin, xmax, ymin, ymax])
6345+
6346+
# test that the docstring is correct
6347+
assert tuple(extent) == (xmin, xmax, ymin, ymax)
6348+
6349+
# test that limits were set per the docstring
6350+
assert (xmin, xmax) == ax.get_xlim()
6351+
assert (ymin, ymax) == ax.get_ylim()
6352+
6353+
63386354
def test_datetime_masked():
63396355
# make sure that all-masked data falls back to the viewlim
63406356
# set in convert.axisinfo....

0 commit comments

Comments
 (0)