Skip to content

Navigation Menu

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 db4e67c

Browse filesBrowse files
oscargusQuLogic
authored andcommitted
Change first argument to set_[xyz]lim to two arguments
1 parent f797268 commit db4e67c
Copy full SHA for db4e67c

33 files changed

+101
-101
lines changed

‎doc/users/prev_whats_new/dflt_style_changes.rst

Copy file name to clipboardExpand all lines: doc/users/prev_whats_new/dflt_style_changes.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,7 @@ a cleaner separation between subplots.
10051005

10061006
ax = fig.add_subplot(2, 2, j)
10071007
ax.hist(np.random.beta(0.5, 0.5, 10000), 25, density=True)
1008-
ax.set_xlim([0, 1])
1008+
ax.set_xlim(0, 1)
10091009
ax.set_title(title)
10101010

10111011
ax = fig.add_subplot(2, 2, j + 2)

‎doc/users/prev_whats_new/whats_new_3.5.0.rst

Copy file name to clipboardExpand all lines: doc/users/prev_whats_new/whats_new_3.5.0.rst
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,9 +375,9 @@ attribute.
375375
points = ax.scatter((3, 3), (1, 3), (1, 3), c='red', zorder=10,
376376
label='zorder=10')
377377

378-
ax.set_xlim((0, 5))
379-
ax.set_ylim((0, 5))
380-
ax.set_zlim((0, 2.5))
378+
ax.set_xlim(0, 5)
379+
ax.set_ylim(0, 5)
380+
ax.set_zlim(0, 2.5)
381381

382382
plane = mpatches.Patch(facecolor='white', edgecolor='black',
383383
label='zorder=1')
@@ -485,7 +485,7 @@ new styling parameters for the added handles.
485485
ax = ax_old
486486
valmin = 0
487487
valinit = 0.5
488-
ax.set_xlim([0, 1])
488+
ax.set_xlim(0, 1)
489489
ax_old.axvspan(valmin, valinit, 0, 1)
490490
ax.axvline(valinit, 0, 1, color="r", lw=1)
491491
ax.set_xticks([])

‎galleries/examples/animation/simple_scatter.py

Copy file name to clipboardExpand all lines: galleries/examples/animation/simple_scatter.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import matplotlib.animation as animation
1212

1313
fig, ax = plt.subplots()
14-
ax.set_xlim([0, 10])
14+
ax.set_xlim(0, 10)
1515

1616
scat = ax.scatter(1, 0)
1717
x = np.linspace(0, 10)

‎galleries/examples/event_handling/poly_editor.py

Copy file name to clipboardExpand all lines: galleries/examples/event_handling/poly_editor.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,6 @@ def on_mouse_move(self, event):
203203
p = PolygonInteractor(ax, poly)
204204

205205
ax.set_title('Click and drag a point to move it')
206-
ax.set_xlim((-2, 2))
207-
ax.set_ylim((-2, 2))
206+
ax.set_xlim(-2, 2)
207+
ax.set_ylim(-2, 2)
208208
plt.show()

‎galleries/examples/event_handling/pong_sgskip.py

Copy file name to clipboardExpand all lines: galleries/examples/event_handling/pong_sgskip.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,9 +134,9 @@ def __init__(self, ax):
134134
# create the initial line
135135
self.ax = ax
136136
ax.xaxis.set_visible(False)
137-
ax.set_xlim([0, 7])
137+
ax.set_xlim(0, 7)
138138
ax.yaxis.set_visible(False)
139-
ax.set_ylim([-1, 1])
139+
ax.set_ylim(-1, 1)
140140
pad_a_x = 0
141141
pad_b_x = .50
142142
pad_a_y = pad_b_y = .30

‎galleries/examples/lines_bars_and_markers/eventcollection_demo.py

Copy file name to clipboardExpand all lines: galleries/examples/lines_bars_and_markers/eventcollection_demo.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353
ax.add_collection(yevents2)
5454

5555
# set the limits
56-
ax.set_xlim([0, 1])
57-
ax.set_ylim([0, 1])
56+
ax.set_xlim(0, 1)
57+
ax.set_ylim(0, 1)
5858

5959
ax.set_title('line plot with data points')
6060

‎galleries/examples/lines_bars_and_markers/markevery_demo.py

Copy file name to clipboardExpand all lines: galleries/examples/lines_bars_and_markers/markevery_demo.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@
7979
for ax, markevery in zip(axs.flat, cases):
8080
ax.set_title(f'markevery={markevery}')
8181
ax.plot(x, y, 'o', ls='-', ms=4, markevery=markevery)
82-
ax.set_xlim((6, 6.7))
83-
ax.set_ylim((1.1, 1.7))
82+
ax.set_xlim(6, 6.7)
83+
ax.set_ylim(1.1, 1.7)
8484

8585
# %%
8686
# markevery on polar plots

‎galleries/examples/shapes_and_collections/hatch_demo.py

Copy file name to clipboardExpand all lines: galleries/examples/shapes_and_collections/hatch_demo.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
hatch='*', facecolor='y'))
4242
axs['patches'].add_patch(Polygon([(10, 20), (30, 50), (50, 10)],
4343
hatch='\\/...', facecolor='g'))
44-
axs['patches'].set_xlim([0, 40])
45-
axs['patches'].set_ylim([10, 60])
44+
axs['patches'].set_xlim(0, 40)
45+
axs['patches'].set_ylim(10, 60)
4646
axs['patches'].set_aspect(1)
4747
plt.show()
4848

‎galleries/examples/showcase/xkcd.py

Copy file name to clipboardExpand all lines: galleries/examples/showcase/xkcd.py
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
ax.spines[['top', 'right']].set_visible(False)
2020
ax.set_xticks([])
2121
ax.set_yticks([])
22-
ax.set_ylim([-30, 10])
22+
ax.set_ylim(-30, 10)
2323

2424
data = np.ones(100)
2525
data[70:] -= np.arange(30)
@@ -50,9 +50,9 @@
5050
ax.xaxis.set_ticks_position('bottom')
5151
ax.set_xticks([0, 1])
5252
ax.set_xticklabels(['CONFIRMED BY\nEXPERIMENT', 'REFUTED BY\nEXPERIMENT'])
53-
ax.set_xlim([-0.5, 1.5])
53+
ax.set_xlim(-0.5, 1.5)
5454
ax.set_yticks([])
55-
ax.set_ylim([0, 110])
55+
ax.set_ylim(0, 110)
5656

5757
ax.set_title("CLAIMS OF SUPERNATURAL POWERS")
5858

‎galleries/examples/statistics/errorbar_limits.py

Copy file name to clipboardExpand all lines: galleries/examples/statistics/errorbar_limits.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
linestyle='none')
7272

7373
# tidy up the figure
74-
ax.set_xlim((0, 5.5))
74+
ax.set_xlim(0, 5.5)
7575
ax.set_title('Errorbar upper and lower limits')
7676
plt.show()
7777

‎galleries/examples/user_interfaces/fourier_demo_wx_sgskip.py

Copy file name to clipboardExpand all lines: galleries/examples/user_interfaces/fourier_demo_wx_sgskip.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -194,10 +194,10 @@ def createPlots(self):
194194
self.subplot1.set_xlabel("frequency f", fontsize=8)
195195
self.subplot2.set_ylabel("Time Domain Waveform x(t)", fontsize=8)
196196
self.subplot2.set_xlabel("time t", fontsize=8)
197-
self.subplot1.set_xlim([-6, 6])
198-
self.subplot1.set_ylim([0, 1])
199-
self.subplot2.set_xlim([-2, 2])
200-
self.subplot2.set_ylim([-2, 2])
197+
self.subplot1.set_xlim(-6, 6)
198+
self.subplot1.set_ylim(0, 1)
199+
self.subplot2.set_xlim(-2, 2)
200+
self.subplot2.set_ylim(-2, 2)
201201
self.subplot1.text(0.05, .95,
202202
r'$X(f) = \mathcal{F}\{x(t)\}$',
203203
verticalalignment='top',

‎galleries/users_explain/artists/transforms_tutorial.py

Copy file name to clipboardExpand all lines: galleries/users_explain/artists/transforms_tutorial.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@
401401
fig, ax = plt.subplots()
402402
xdata, ydata = (0.2, 0.7), (0.5, 0.5)
403403
ax.plot(xdata, ydata, "o")
404-
ax.set_xlim((0, 1))
404+
ax.set_xlim(0, 1)
405405

406406
trans = (fig.dpi_scale_trans +
407407
transforms.ScaledTranslation(xdata[0], ydata[0], ax.transData))

‎galleries/users_explain/axes/axes_intro.rst

Copy file name to clipboardExpand all lines: galleries/users_explain/axes/axes_intro.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ Other important methods set the extent on the axes (`~.axes.Axes.set_xlim`, `~.a
143143
x = 2**np.cumsum(np.random.randn(200))
144144
linesx = ax.plot(t, x)
145145
ax.set_yscale('log')
146-
ax.set_xlim([20, 180])
146+
ax.set_xlim(20, 180)
147147

148148
The Axes class also has helpers to deal with Axis ticks and their labels. Most straight-forward is `~.axes.Axes.set_xticks` and `~.axes.Axes.set_yticks` which manually set the tick locations and optionally their labels. Minor ticks can be toggled with `~.axes.Axes.minorticks_on` or `~.axes.Axes.minorticks_off`.
149149

‎galleries/users_explain/axes/axes_scales.py

Copy file name to clipboardExpand all lines: galleries/users_explain/axes/axes_scales.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def inverse(a):
171171
ax.set_yscale('function', functions=(forward, inverse))
172172
ax.set_title('function: Mercator')
173173
ax.grid(True)
174-
ax.set_xlim([0, 180])
174+
ax.set_xlim(0, 180)
175175
ax.yaxis.set_minor_formatter(NullFormatter())
176176
ax.yaxis.set_major_locator(FixedLocator(np.arange(0, 90, 10)))
177177

‎lib/matplotlib/axes/_base.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_base.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2179,9 +2179,9 @@ def axis(self, arg=None, /, *, emit=True, **kwargs):
21792179
xlim = self.get_xlim()
21802180
ylim = self.get_ylim()
21812181
edge_size = max(np.diff(xlim), np.diff(ylim))[0]
2182-
self.set_xlim([xlim[0], xlim[0] + edge_size],
2182+
self.set_xlim(xlim[0], xlim[0] + edge_size,
21832183
emit=emit, auto=False)
2184-
self.set_ylim([ylim[0], ylim[0] + edge_size],
2184+
self.set_ylim(ylim[0], ylim[0] + edge_size,
21852185
emit=emit, auto=False)
21862186
else:
21872187
raise ValueError(f"Unrecognized string {arg!r} to axis; "

‎lib/matplotlib/image.py

Copy file name to clipboardExpand all lines: lib/matplotlib/image.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -967,9 +967,9 @@ def set_extent(self, extent, **kwargs):
967967
self.sticky_edges.x[:] = [xmin, xmax]
968968
self.sticky_edges.y[:] = [ymin, ymax]
969969
if self.axes.get_autoscalex_on():
970-
self.axes.set_xlim((xmin, xmax), auto=None)
970+
self.axes.set_xlim(xmin, xmax, auto=None)
971971
if self.axes.get_autoscaley_on():
972-
self.axes.set_ylim((ymin, ymax), auto=None)
972+
self.axes.set_ylim(ymin, ymax, auto=None)
973973
self.stale = True
974974

975975
def get_extent(self):

‎lib/matplotlib/tests/test_arrow_patches.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_arrow_patches.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ def __prepare_fancyarrow_dpi_cor_test():
5959
"""
6060
fig2 = plt.figure("fancyarrow_dpi_cor_test", figsize=(4, 3), dpi=50)
6161
ax = fig2.add_subplot()
62-
ax.set_xlim([0, 1])
63-
ax.set_ylim([0, 1])
62+
ax.set_xlim(0, 1)
63+
ax.set_ylim(0, 1)
6464
ax.add_patch(mpatches.FancyArrowPatch(posA=(0.3, 0.4), posB=(0.8, 0.6),
6565
lw=3, arrowstyle='->',
6666
mutation_scale=100))

‎lib/matplotlib/tests/test_artist.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_artist.py
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ def test_clipping():
120120
patch.set_clip_path(clip_path, ax2.transData)
121121
ax2.add_patch(patch)
122122

123-
ax1.set_xlim([-3, 3])
124-
ax1.set_ylim([-3, 3])
123+
ax1.set_xlim(-3, 3)
124+
ax1.set_ylim(-3, 3)
125125

126126

127127
@check_figures_equal()
@@ -226,8 +226,8 @@ def test_default_edges():
226226
np.arange(10) + 1, np.arange(10), 'o')
227227
ax2.bar(np.arange(10), np.arange(10), align='edge')
228228
ax3.text(0, 0, "BOX", size=24, bbox=dict(boxstyle='sawtooth'))
229-
ax3.set_xlim((-1, 1))
230-
ax3.set_ylim((-1, 1))
229+
ax3.set_xlim(-1, 1)
230+
ax3.set_ylim(-1, 1)
231231
pp1 = mpatches.PathPatch(
232232
mpath.Path([(0, 0), (1, 0), (1, 1), (0, 0)],
233233
[mpath.Path.MOVETO, mpath.Path.CURVE3,

‎lib/matplotlib/tests/test_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+25-25Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3262,16 +3262,16 @@ def test_stackplot():
32623262
y3 = 3.0 * x + 2
32633263
ax = fig.add_subplot(1, 1, 1)
32643264
ax.stackplot(x, y1, y2, y3)
3265-
ax.set_xlim((0, 10))
3266-
ax.set_ylim((0, 70))
3265+
ax.set_xlim(0, 10)
3266+
ax.set_ylim(0, 70)
32673267

32683268
# Reuse testcase from above for a test with labeled data and with colours
32693269
# from the Axes property cycle.
32703270
data = {"x": x, "y1": y1, "y2": y2, "y3": y3}
32713271
fig, ax = plt.subplots()
32723272
ax.stackplot("x", "y1", "y2", "y3", data=data, colors=["C0", "C1", "C2"])
3273-
ax.set_xlim((0, 10))
3274-
ax.set_ylim((0, 70))
3273+
ax.set_xlim(0, 10)
3274+
ax.set_ylim(0, 70)
32753275

32763276

32773277
@image_comparison(['stackplot_test_baseline.png'], remove_text=True)
@@ -3308,16 +3308,16 @@ def test_stackplot_hatching(fig_ref, fig_test):
33083308
# stackplot with different hatching styles (issue #27146)
33093309
ax_test = fig_test.subplots()
33103310
ax_test.stackplot(x, y1, y2, y3, hatch=["x", "//", "\\\\"], colors=["white"])
3311-
ax_test.set_xlim((0, 10))
3312-
ax_test.set_ylim((0, 70))
3311+
ax_test.set_xlim(0, 10)
3312+
ax_test.set_ylim(0, 70)
33133313
# compare with result from hatching each layer individually
33143314
stack_baseline = np.zeros(len(x))
33153315
ax_ref = fig_ref.subplots()
33163316
ax_ref.fill_between(x, stack_baseline, y1, hatch="x", facecolor="white")
33173317
ax_ref.fill_between(x, y1, y1+y2, hatch="//", facecolor="white")
33183318
ax_ref.fill_between(x, y1+y2, y1+y2+y3, hatch="\\\\", facecolor="white")
3319-
ax_ref.set_xlim((0, 10))
3320-
ax_ref.set_ylim((0, 70))
3319+
ax_ref.set_xlim(0, 10)
3320+
ax_ref.set_ylim(0, 70)
33213321

33223322

33233323
def _bxp_test_helper(
@@ -3594,13 +3594,13 @@ def test_boxplot():
35943594
fig, ax = plt.subplots()
35953595

35963596
ax.boxplot([x, x], bootstrap=10000, notch=1)
3597-
ax.set_ylim((-30, 30))
3597+
ax.set_ylim(-30, 30)
35983598

35993599
# Reuse testcase from above for a labeled data test
36003600
data = {"x": [x, x]}
36013601
fig, ax = plt.subplots()
36023602
ax.boxplot("x", bootstrap=10000, notch=1, data=data)
3603-
ax.set_ylim((-30, 30))
3603+
ax.set_ylim(-30, 30)
36043604

36053605

36063606
@check_figures_equal()
@@ -3638,10 +3638,10 @@ def test_boxplot_sym2():
36383638
fig, [ax1, ax2] = plt.subplots(1, 2)
36393639

36403640
ax1.boxplot([x, x], bootstrap=10000, sym='^')
3641-
ax1.set_ylim((-30, 30))
3641+
ax1.set_ylim(-30, 30)
36423642

36433643
ax2.boxplot([x, x], bootstrap=10000, sym='g')
3644-
ax2.set_ylim((-30, 30))
3644+
ax2.set_ylim(-30, 30)
36453645

36463646

36473647
@image_comparison(['boxplot_sym.png'],
@@ -3654,7 +3654,7 @@ def test_boxplot_sym():
36543654
fig, ax = plt.subplots()
36553655

36563656
ax.boxplot([x, x], sym='gs')
3657-
ax.set_ylim((-30, 30))
3657+
ax.set_ylim(-30, 30)
36583658

36593659

36603660
@image_comparison(['boxplot_autorange_false_whiskers.png',
@@ -3669,11 +3669,11 @@ def test_boxplot_autorange_whiskers():
36693669

36703670
fig1, ax1 = plt.subplots()
36713671
ax1.boxplot([x, x], bootstrap=10000, notch=1)
3672-
ax1.set_ylim((-5, 5))
3672+
ax1.set_ylim(-5, 5)
36733673

36743674
fig2, ax2 = plt.subplots()
36753675
ax2.boxplot([x, x], bootstrap=10000, notch=1, autorange=True)
3676-
ax2.set_ylim((-5, 5))
3676+
ax2.set_ylim(-5, 5)
36773677

36783678

36793679
def _rc_test_bxp_helper(ax, rc_dict):
@@ -3763,7 +3763,7 @@ def test_boxplot_with_CIarray():
37633763
# another with manual values
37643764
ax.boxplot([x, x], bootstrap=10000, usermedians=[None, 1.0],
37653765
conf_intervals=CIs, notch=1)
3766-
ax.set_ylim((-30, 30))
3766+
ax.set_ylim(-30, 30)
37673767

37683768

37693769
@image_comparison(['boxplot_no_inverted_whisker.png'],
@@ -4352,7 +4352,7 @@ def test_errorbar_limits():
43524352
xlolims=xlolims, xuplims=xuplims, uplims=uplims,
43534353
lolims=lolims, ls='none', mec='blue', capsize=0,
43544354
color='cyan')
4355-
ax.set_xlim((0, 5.5))
4355+
ax.set_xlim(0, 5.5)
43564356
ax.set_title('Errorbar upper and lower limits')
43574357

43584358

@@ -5282,8 +5282,8 @@ def test_vertex_markers():
52825282
fig, ax = plt.subplots()
52835283
ax.plot(data, linestyle='', marker=marker_as_tuple, mfc='k')
52845284
ax.plot(data[::-1], linestyle='', marker=marker_as_list, mfc='b')
5285-
ax.set_xlim([-1, 10])
5286-
ax.set_ylim([-1, 10])
5285+
ax.set_xlim(-1, 10)
5286+
ax.set_ylim(-1, 10)
52875287

52885288

52895289
@image_comparison(['vline_hline_zorder.png', 'errorbar_zorder.png'],
@@ -5552,8 +5552,8 @@ def test_step_linestyle():
55525552
ax.step(x, y, lw=5, linestyle=ls, where='pre')
55535553
ax.step(x, y + 1, lw=5, linestyle=ls, where='mid')
55545554
ax.step(x, y + 2, lw=5, linestyle=ls, where='post')
5555-
ax.set_xlim([-1, 5])
5556-
ax.set_ylim([-1, 7])
5555+
ax.set_xlim(-1, 5)
5556+
ax.set_ylim(-1, 7)
55575557

55585558
# Reuse testcase from above for a labeled data test
55595559
data = {"X": x, "Y0": y, "Y1": y+1, "Y2": y+2}
@@ -5564,8 +5564,8 @@ def test_step_linestyle():
55645564
ax.step("X", "Y0", lw=5, linestyle=ls, where='pre', data=data)
55655565
ax.step("X", "Y1", lw=5, linestyle=ls, where='mid', data=data)
55665566
ax.step("X", "Y2", lw=5, linestyle=ls, where='post', data=data)
5567-
ax.set_xlim([-1, 5])
5568-
ax.set_ylim([-1, 7])
5567+
ax.set_xlim(-1, 5)
5568+
ax.set_ylim(-1, 7)
55695569

55705570

55715571
@image_comparison(['mixed_collection'], remove_text=True)
@@ -7802,8 +7802,8 @@ def test_zoom_inset():
78027802
axin1 = ax.inset_axes([0.7, 0.7, 0.35, 0.35])
78037803
# redraw the data in the inset axes...
78047804
axin1.pcolormesh(x, y, z[:-1, :-1])
7805-
axin1.set_xlim([1.5, 2.15])
7806-
axin1.set_ylim([2, 2.5])
7805+
axin1.set_xlim(1.5, 2.15)
7806+
axin1.set_ylim(2, 2.5)
78077807
axin1.set_aspect(ax.get_aspect())
78087808

78097809
with pytest.warns(mpl.MatplotlibDeprecationWarning):

‎lib/matplotlib/tests/test_axis.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axis.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ def test_axis_not_in_layout():
1515
fig2, (ax2_left, ax2_right) = plt.subplots(ncols=2, layout='constrained')
1616

1717
# 100 label overlapping the end of the axis
18-
ax1_left.set_xlim([0, 100])
18+
ax1_left.set_xlim(0, 100)
1919
# 100 label not overlapping the end of the axis
20-
ax2_left.set_xlim([0, 120])
20+
ax2_left.set_xlim(0, 120)
2121

2222
for ax in ax1_left, ax2_left:
2323
ax.set_xticks([0, 100])

‎lib/matplotlib/tests/test_colorbar.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_colorbar.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ def test_colorbar_change_lim_scale():
845845

846846
pc = ax[1].pcolormesh(np.arange(100).reshape(10, 10)+1)
847847
cb = fig.colorbar(pc, ax=ax[1], extend='both')
848-
cb.ax.set_ylim([20, 90])
848+
cb.ax.set_ylim(20, 90)
849849

850850

851851
@check_figures_equal()

0 commit comments

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