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

Skip to content

Use True instead of 1 for boolean parameters. #17079

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
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
12 changes: 6 additions & 6 deletions examples/images_contours_and_fields/contour_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

fig, ax = plt.subplots()
CS = ax.contour(X, Y, Z)
ax.clabel(CS, inline=1, fontsize=10)
ax.clabel(CS, inline=True, fontsize=10)
ax.set_title('Simplest default with labels')

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

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

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

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

###############################################################################
Expand All @@ -71,7 +71,7 @@
linewidths=np.arange(.5, 4, .5),
colors=('r', 'green', 'blue', (1, 1, 0), '#afeeee', '0.5'),
)
ax.clabel(CS, fontsize=9, inline=1)
ax.clabel(CS, fontsize=9, inline=True)
ax.set_title('Crazy lines')

###############################################################################
Expand All @@ -90,7 +90,7 @@
plt.setp(zc, linewidth=4)

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

# make a colorbar for the contour lines
CB = fig.colorbar(CS, shrink=0.8)
Expand Down
2 changes: 1 addition & 1 deletion examples/misc/demo_agg_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def filtered_text(ax):

# contour label
cl = ax.clabel(CS, levels[1::2], # label every second level
inline=1,
inline=True,
fmt='%1.1f',
fontsize=11)

Expand Down
2 changes: 1 addition & 1 deletion examples/mplot3d/contour3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
# Plot contour curves
cset = ax.contour(X, Y, Z, cmap=cm.coolwarm)

ax.clabel(cset, fontsize=9, inline=1)
ax.clabel(cset, fontsize=9, inline=True)

plt.show()
2 changes: 1 addition & 1 deletion examples/mplot3d/contour3d_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@

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

ax.clabel(cset, fontsize=9, inline=1)
ax.clabel(cset, fontsize=9, inline=True)

plt.show()
2 changes: 1 addition & 1 deletion examples/mplot3d/contourf3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@

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

ax.clabel(cset, fontsize=9, inline=1)
ax.clabel(cset, fontsize=9, inline=True)

plt.show()