Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4122887

Browse files
committed
Change first argument to set_xlim and set_ylim from list to tuple
1 parent 53383cf commit 4122887

File tree

19 files changed

+32
-32
lines changed

19 files changed

+32
-32
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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/pong_sgskip.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ 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)
139139
ax.set_ylim([-1, 1])
140140
pad_a_x = 0

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/scales/scales.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def inverse(a):
9595
ax.set_yscale('function', functions=(forward, inverse))
9696
ax.set_title('function: Mercator')
9797
ax.grid(True)
98-
ax.set_xlim([0, 180])
98+
ax.set_xlim((0, 180))
9999
ax.yaxis.set_minor_formatter(NullFormatter())
100100
ax.yaxis.set_major_locator(FixedLocator(np.arange(0, 90, 10)))
101101

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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
ax.set_xticklabels(['CONFIRMED BY\nEXPERIMENT', 'REFUTED BY\nEXPERIMENT'])
5353
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/user_interfaces/fourier_demo_wx_sgskip.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ def createPlots(self):
195195
self.subplot2.set_ylabel("Time Domain Waveform x(t)", fontsize=8)
196196
self.subplot2.set_xlabel("time t", fontsize=8)
197197
self.subplot1.set_xlim([-6, 6])
198-
self.subplot1.set_ylim([0, 1])
198+
self.subplot1.set_ylim((0, 1))
199199
self.subplot2.set_xlim([-2, 2])
200200
self.subplot2.set_ylim([-2, 2])
201201
self.subplot1.text(0.05, .95,

galleries/users_explain/axes/axes_intro.rst

Lines 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

0 commit comments

Comments
 (0)