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

Skip to content

Commit dc15e0d

Browse files
authored
Merge pull request #17079 from anntzer/true
Use True instead of 1 for boolean parameters.
2 parents 2c62f06 + ef6babf commit dc15e0d

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

examples/images_contours_and_fields/contour_demo.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
fig, ax = plt.subplots()
3333
CS = ax.contour(X, Y, Z)
34-
ax.clabel(CS, inline=1, fontsize=10)
34+
ax.clabel(CS, inline=True, fontsize=10)
3535
ax.set_title('Simplest default with labels')
3636

3737
###############################################################################
@@ -43,15 +43,15 @@
4343
CS = ax.contour(X, Y, Z)
4444
manual_locations = [
4545
(-1, -1.4), (-0.62, -0.7), (-2, 0.5), (1.7, 1.2), (2.0, 1.4), (2.4, 1.7)]
46-
ax.clabel(CS, inline=1, fontsize=10, manual=manual_locations)
46+
ax.clabel(CS, inline=True, fontsize=10, manual=manual_locations)
4747
ax.set_title('labels at selected locations')
4848

4949
###############################################################################
5050
# You can force all the contours to be the same color.
5151

5252
fig, ax = plt.subplots()
5353
CS = ax.contour(X, Y, Z, 6, colors='k') # Negative contours default to dashed.
54-
ax.clabel(CS, fontsize=9, inline=1)
54+
ax.clabel(CS, fontsize=9, inline=True)
5555
ax.set_title('Single color - negative contours dashed')
5656

5757
###############################################################################
@@ -60,7 +60,7 @@
6060
matplotlib.rcParams['contour.negative_linestyle'] = 'solid'
6161
fig, ax = plt.subplots()
6262
CS = ax.contour(X, Y, Z, 6, colors='k') # Negative contours default to dashed.
63-
ax.clabel(CS, fontsize=9, inline=1)
63+
ax.clabel(CS, fontsize=9, inline=True)
6464
ax.set_title('Single color - negative contours solid')
6565

6666
###############################################################################
@@ -71,7 +71,7 @@
7171
linewidths=np.arange(.5, 4, .5),
7272
colors=('r', 'green', 'blue', (1, 1, 0), '#afeeee', '0.5'),
7373
)
74-
ax.clabel(CS, fontsize=9, inline=1)
74+
ax.clabel(CS, fontsize=9, inline=True)
7575
ax.set_title('Crazy lines')
7676

7777
###############################################################################
@@ -90,7 +90,7 @@
9090
plt.setp(zc, linewidth=4)
9191

9292
ax.clabel(CS, levels[1::2], # label every second level
93-
inline=1, fmt='%1.1f', fontsize=14)
93+
inline=True, fmt='%1.1f', fontsize=14)
9494

9595
# make a colorbar for the contour lines
9696
CB = fig.colorbar(CS, shrink=0.8)

examples/misc/demo_agg_filter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ def filtered_text(ax):
170170

171171
# contour label
172172
cl = ax.clabel(CS, levels[1::2], # label every second level
173-
inline=1,
173+
inline=True,
174174
fmt='%1.1f',
175175
fontsize=11)
176176

examples/mplot3d/contour3d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818
# Plot contour curves
1919
cset = ax.contour(X, Y, Z, cmap=cm.coolwarm)
2020

21-
ax.clabel(cset, fontsize=9, inline=1)
21+
ax.clabel(cset, fontsize=9, inline=True)
2222

2323
plt.show()

examples/mplot3d/contour3d_2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717

1818
cset = ax.contour(X, Y, Z, extend3d=True, cmap=cm.coolwarm)
1919

20-
ax.clabel(cset, fontsize=9, inline=1)
20+
ax.clabel(cset, fontsize=9, inline=True)
2121

2222
plt.show()

examples/mplot3d/contourf3d.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020

2121
cset = ax.contourf(X, Y, Z, cmap=cm.coolwarm)
2222

23-
ax.clabel(cset, fontsize=9, inline=1)
23+
ax.clabel(cset, fontsize=9, inline=True)
2424

2525
plt.show()

0 commit comments

Comments
 (0)