Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Ensure tuples are passed to Axes.set([xyz]lim=...)
  • Loading branch information
QuLogic committed Apr 16, 2025
commit edc8b20f3f05a1b16f2145ebc8e73ad9967ae4c1
2 changes: 1 addition & 1 deletion galleries/examples/mplot3d/box3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
xmin, xmax = X.min(), X.max()
ymin, ymax = Y.min(), Y.max()
zmin, zmax = Z.min(), Z.max()
ax.set(xlim=[xmin, xmax], ylim=[ymin, ymax], zlim=[zmin, zmax])
ax.set(xlim=(xmin, xmax), ylim=(ymin, ymax), zlim=(zmin, zmax))

# Plot edges
edges_kw = dict(color='0.4', linewidth=1, zorder=1e3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def bullseye_plot(ax, data, seg_bold=None, cmap="viridis", norm=None):

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

ax.set(ylim=[0, 1], xticklabels=[], yticklabels=[])
ax.set(ylim=(0, 1), xticklabels=[], yticklabels=[])
ax.grid(False) # Remove grid

# Fill segments 1-6, 7-12, 13-16.
Expand Down
8 changes: 4 additions & 4 deletions galleries/tutorials/lifecycle.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@
ax.barh(group_names, group_data)
labels = ax.get_xticklabels()
plt.setp(labels, rotation=45, horizontalalignment='right')
ax.set(xlim=[-10000, 140000], xlabel='Total Revenue', ylabel='Company',
ax.set(xlim=(-10000, 140000), xlabel='Total Revenue', ylabel='Company',
title='Company Revenue')

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

# %%
Expand Down Expand Up @@ -220,7 +220,7 @@ def currency(x, pos):
labels = ax.get_xticklabels()
plt.setp(labels, rotation=45, horizontalalignment='right')

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

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

ax.set(xlim=[-10000, 140000], xlabel='Total Revenue', ylabel='Company',
ax.set(xlim=(-10000, 140000), xlabel='Total Revenue', ylabel='Company',
title='Company Revenue')
ax.xaxis.set_major_formatter(currency)
ax.set_xticks([0, 25e3, 50e3, 75e3, 100e3, 125e3])
Expand Down
2 changes: 1 addition & 1 deletion galleries/users_explain/animations/animations.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@

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


Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/tests/test_usetex.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def test_rotation():

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

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