Skip to content

Commit fb47087

Browse files
committed
DOC: fix parameters line in Axes.axis docstring
1 parent 7986245 commit fb47087

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1628,7 +1628,7 @@ def axis(self, *args, **kwargs):
16281628
16291629
Parameters
16301630
----------
1631-
xmin, ymin, xmax, ymax : float, optional
1631+
xmin, xmax, ymin, ymax : float, optional
16321632
The axis limits to be set. Either none or all of the limits must
16331633
be given. This can also be achieved using ::
16341634

lib/matplotlib/tests/test_axes.py

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

64526452

6453+
def test_axis_extent_arg():
6454+
fig, ax = plt.subplots()
6455+
xmin = 5
6456+
xmax = 10
6457+
ymin = 15
6458+
ymax = 20
6459+
extent = ax.axis([xmin, xmax, ymin, ymax])
6460+
6461+
# test that the docstring is correct
6462+
assert tuple(extent) == (xmin, xmax, ymin, ymax)
6463+
6464+
# test that limits were set per the docstring
6465+
assert (xmin, xmax) == ax.get_xlim()
6466+
assert (ymin, ymax) == ax.get_ylim()
6467+
6468+
64536469
def test_datetime_masked():
64546470
# make sure that all-masked data falls back to the viewlim
64556471
# set in convert.axisinfo....

0 commit comments

Comments
 (0)