Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 330f4b4

Browse filesBrowse files
timhoffmMeeseeksDev[bot]
authored andcommitted
Backport PR #14228: DOC: fix parameters line in Axes.axis docstring
1 parent 41a8d62 commit 330f4b4
Copy full SHA for 330f4b4

File tree

Expand file treeCollapse file tree

2 files changed

+17
-1
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+17
-1
lines changed

‎lib/matplotlib/axes/_base.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_base.py
+1-1Lines 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

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+16Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.