Skip to content

Commit db4e67c

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

33 files changed

+101
-101
lines changed

doc/users/prev_whats_new/dflt_style_changes.rst

Lines 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

Lines 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

Lines 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

Lines 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

Lines 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

Lines 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

Lines 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

Lines 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

Lines 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

Lines 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

0 commit comments

Comments
 (0)