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 5a927c1

Browse filesBrowse files
authored
Merge pull request #11293 from timhoffm/lim-parameter-naming
MNT: Lim parameter naming Prevent internally generated warning messages.
2 parents 1285e59 + bf0a355 commit 5a927c1
Copy full SHA for 5a927c1

File tree

Expand file treeCollapse file tree

5 files changed

+23
-22
lines changed
Filter options
Expand file treeCollapse file tree

5 files changed

+23
-22
lines changed

‎examples/scales/log_demo.py

Copy file name to clipboardExpand all lines: examples/scales/log_demo.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
ax4.set(title='Errorbars go negative')
4141
ax4.errorbar(x, y, xerr=0.1 * x, yerr=5.0 + 0.75 * y)
4242
# ylim must be set after errorbar to allow errorbar to autoscale limits
43-
ax4.set_ylim(ymin=0.1)
43+
ax4.set_ylim(bottom=0.1)
4444

4545
fig.tight_layout()
4646
plt.show()

‎lib/matplotlib/axes/_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_axes.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7423,8 +7423,8 @@ def spy(self, Z, precision=0, marker=None, markersize=None,
74237423
marker=marker, markersize=markersize, **kwargs)
74247424
self.add_line(marks)
74257425
nr, nc = Z.shape
7426-
self.set_xlim(xmin=-0.5, xmax=nc - 0.5)
7427-
self.set_ylim(ymin=nr - 0.5, ymax=-0.5)
7426+
self.set_xlim(-0.5, nc - 0.5)
7427+
self.set_ylim(nr - 0.5, -0.5)
74287428
self.set_aspect(aspect)
74297429
ret = marks
74307430
self.title.set_y(1.05)

‎lib/matplotlib/pyplot.py

Copy file name to clipboardExpand all lines: lib/matplotlib/pyplot.py
+16-15Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,20 +1310,21 @@ def xlim(*args, **kwargs):
13101310
13111311
Call signatures::
13121312
1313-
xmin, xmax = xlim() # return the current xlim
1314-
xlim((xmin, xmax)) # set the xlim to xmin, xmax
1315-
xlim(xmin, xmax) # set the xlim to xmin, xmax
1313+
left, right = xlim() # return the current xlim
1314+
xlim((left, right)) # set the xlim to left, right
1315+
xlim(left, right) # set the xlim to left, right
13161316
1317-
If you do not specify args, you can pass *xmin* or *xmax* as kwargs, i.e.::
1317+
If you do not specify args, you can pass *left* or *right* as kwargs,
1318+
i.e.::
13181319
1319-
xlim(xmax=3) # adjust the max leaving min unchanged
1320-
xlim(xmin=1) # adjust the min leaving max unchanged
1320+
xlim(right=3) # adjust the right leaving left unchanged
1321+
xlim(left=1) # adjust the left leaving right unchanged
13211322
13221323
Setting limits turns autoscaling off for the x-axis.
13231324
13241325
Returns
13251326
-------
1326-
xmin, xmax
1327+
left, right
13271328
A tuple of the new x-axis limits.
13281329
13291330
Notes
@@ -1346,21 +1347,21 @@ def ylim(*args, **kwargs):
13461347
13471348
Call signatures::
13481349
1349-
ymin, ymax = ylim() # return the current ylim
1350-
ylim((ymin, ymax)) # set the ylim to ymin, ymax
1351-
ylim(ymin, ymax) # set the ylim to ymin, ymax
1350+
bottom, top = ylim() # return the current ylim
1351+
ylim((bottom, top)) # set the ylim to bottom, top
1352+
ylim(bottom, top) # set the ylim to bottom, top
13521353
1353-
If you do not specify args, you can alternatively pass *ymin* or *ymax* as
1354-
kwargs, i.e.::
1354+
If you do not specify args, you can alternatively pass *bottom* or
1355+
*top* as kwargs, i.e.::
13551356
1356-
ylim(ymax=3) # adjust the max leaving min unchanged
1357-
ylim(ymin=1) # adjust the min leaving max unchanged
1357+
ylim(top=3) # adjust the top leaving bottom unchanged
1358+
ylim(bottom=1) # adjust the top leaving bottom unchanged
13581359
13591360
Setting limits turns autoscaling off for the y-axis.
13601361
13611362
Returns
13621363
-------
1363-
ymin, ymax
1364+
bottom, top
13641365
A tuple of the new y-axis limits.
13651366
13661367
Notes

‎lib/matplotlib/tests/test_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1577,7 +1577,7 @@ def test_hist_step_filled():
15771577
for kg, _type, ax in zip(kwargs, types, axes):
15781578
ax.hist(x, n_bins, histtype=_type, stacked=True, **kg)
15791579
ax.set_title('%s/%s' % (kg, _type))
1580-
ax.set_ylim(ymin=-50)
1580+
ax.set_ylim(bottom=-50)
15811581

15821582
patches = axes[0].patches
15831583
assert all(p.get_facecolor() == p.get_edgecolor() for p in patches)

‎lib/matplotlib/tests/test_simplification.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_simplification.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def test_overflow():
3333

3434
fig, ax = plt.subplots()
3535
ax.plot(x, y)
36-
ax.set_xlim(xmin=2, xmax=6)
36+
ax.set_xlim(2, 6)
3737

3838

3939
@image_comparison(baseline_images=['clipping_diamond'], remove_text=True)
@@ -43,8 +43,8 @@ def test_diamond():
4343

4444
fig, ax = plt.subplots()
4545
ax.plot(x, y)
46-
ax.set_xlim(xmin=-0.6, xmax=0.6)
47-
ax.set_ylim(ymin=-0.6, ymax=0.6)
46+
ax.set_xlim(-0.6, 0.6)
47+
ax.set_ylim(-0.6, 0.6)
4848

4949

5050
def test_noise():

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.