Skip to content

Commit edc8b20

Browse files
committed
Ensure tuples are passed to Axes.set([xyz]lim=...)
1 parent db4e67c commit edc8b20

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

galleries/examples/mplot3d/box3d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
xmin, xmax = X.min(), X.max()
5252
ymin, ymax = Y.min(), Y.max()
5353
zmin, zmax = Z.min(), Z.max()
54-
ax.set(xlim=[xmin, xmax], ylim=[ymin, ymax], zlim=[zmin, zmax])
54+
ax.set(xlim=(xmin, xmax), ylim=(ymin, ymax), zlim=(zmin, zmax))
5555

5656
# Plot edges
5757
edges_kw = dict(color='0.4', linewidth=1, zorder=1e3)

galleries/examples/specialty_plots/leftventricle_bullseye.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def bullseye_plot(ax, data, seg_bold=None, cmap="viridis", norm=None):
5555

5656
r = np.linspace(0.2, 1, 4)
5757

58-
ax.set(ylim=[0, 1], xticklabels=[], yticklabels=[])
58+
ax.set(ylim=(0, 1), xticklabels=[], yticklabels=[])
5959
ax.grid(False) # Remove grid
6060

6161
# Fill segments 1-6, 7-12, 13-16.

galleries/tutorials/lifecycle.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@
169169
ax.barh(group_names, group_data)
170170
labels = ax.get_xticklabels()
171171
plt.setp(labels, rotation=45, horizontalalignment='right')
172-
ax.set(xlim=[-10000, 140000], xlabel='Total Revenue', ylabel='Company',
172+
ax.set(xlim=(-10000, 140000), xlabel='Total Revenue', ylabel='Company',
173173
title='Company Revenue')
174174

175175
# %%
@@ -187,7 +187,7 @@
187187
ax.barh(group_names, group_data)
188188
labels = ax.get_xticklabels()
189189
plt.setp(labels, rotation=45, horizontalalignment='right')
190-
ax.set(xlim=[-10000, 140000], xlabel='Total Revenue', ylabel='Company',
190+
ax.set(xlim=(-10000, 140000), xlabel='Total Revenue', ylabel='Company',
191191
title='Company Revenue')
192192

193193
# %%
@@ -220,7 +220,7 @@ def currency(x, pos):
220220
labels = ax.get_xticklabels()
221221
plt.setp(labels, rotation=45, horizontalalignment='right')
222222

223-
ax.set(xlim=[-10000, 140000], xlabel='Total Revenue', ylabel='Company',
223+
ax.set(xlim=(-10000, 140000), xlabel='Total Revenue', ylabel='Company',
224224
title='Company Revenue')
225225
ax.xaxis.set_major_formatter(currency)
226226

@@ -248,7 +248,7 @@ def currency(x, pos):
248248
# Now we move our title up since it's getting a little cramped
249249
ax.title.set(y=1.05)
250250

251-
ax.set(xlim=[-10000, 140000], xlabel='Total Revenue', ylabel='Company',
251+
ax.set(xlim=(-10000, 140000), xlabel='Total Revenue', ylabel='Company',
252252
title='Company Revenue')
253253
ax.xaxis.set_major_formatter(currency)
254254
ax.set_xticks([0, 25e3, 50e3, 75e3, 100e3, 125e3])

galleries/users_explain/animations/animations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111

112112
scat = ax.scatter(t[0], z[0], c="b", s=5, label=f'v0 = {v0} m/s')
113113
line2 = ax.plot(t[0], z2[0], label=f'v0 = {v02} m/s')[0]
114-
ax.set(xlim=[0, 3], ylim=[-4, 10], xlabel='Time [s]', ylabel='Z [m]')
114+
ax.set(xlim=(0, 3), ylim=(-4, 10), xlabel='Time [s]', ylabel='Z [m]')
115115
ax.legend()
116116

117117

lib/matplotlib/tests/test_usetex.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def test_rotation():
169169

170170
fig = plt.figure()
171171
ax = fig.add_axes((0, 0, 1, 1))
172-
ax.set(xlim=[-0.5, 5], xticks=[], ylim=[-0.5, 3], yticks=[], frame_on=False)
172+
ax.set(xlim=(-0.5, 5), xticks=[], ylim=(-0.5, 3), yticks=[], frame_on=False)
173173

174174
text = {val: val[0] for val in ['top', 'center', 'bottom', 'left', 'right']}
175175
text['baseline'] = 'B'

0 commit comments

Comments
 (0)