Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 126d2cc

Browse filesBrowse files
committed
Don't pass redundant inline=True to example clabel() calls.
`inline=True` ("break the contour lines under the labels) is already the default.
1 parent 202a277 commit 126d2cc
Copy full SHA for 126d2cc

File tree

3 files changed

+8
-9
lines changed
Filter options

3 files changed

+8
-9
lines changed

‎galleries/examples/images_contours_and_fields/contour_demo.py

Copy file name to clipboardExpand all lines: galleries/examples/images_contours_and_fields/contour_demo.py
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

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

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

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

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

5656
# %%
@@ -59,7 +59,7 @@
5959
plt.rcParams['contour.negative_linestyle'] = 'solid'
6060
fig, ax = plt.subplots()
6161
CS = ax.contour(X, Y, Z, 6, colors='k') # Negative contours default to dashed.
62-
ax.clabel(CS, fontsize=9, inline=True)
62+
ax.clabel(CS, fontsize=9)
6363
ax.set_title('Single color - negative contours solid')
6464

6565
# %%
@@ -70,7 +70,7 @@
7070
linewidths=np.arange(.5, 4, .5),
7171
colors=('r', 'green', 'blue', (1, 1, 0), '#afeeee', '0.5'),
7272
)
73-
ax.clabel(CS, fontsize=9, inline=True)
73+
ax.clabel(CS, fontsize=9)
7474
ax.set_title('Crazy lines')
7575

7676
# %%
@@ -90,7 +90,7 @@
9090
CS.set_linewidth(lws)
9191

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

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

‎galleries/examples/images_contours_and_fields/contour_label_demo.py

Copy file name to clipboardExpand all lines: galleries/examples/images_contours_and_fields/contour_label_demo.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def fmt(x):
4343
fig, ax = plt.subplots()
4444
CS = ax.contour(X, Y, Z)
4545

46-
ax.clabel(CS, CS.levels, inline=True, fmt=fmt, fontsize=10)
46+
ax.clabel(CS, CS.levels, fmt=fmt, fontsize=10)
4747

4848
# %%
4949
# Label contours with arbitrary strings using a dictionary
@@ -59,7 +59,7 @@ def fmt(x):
5959
fmt[l] = s
6060

6161
# Label every other level using strings
62-
ax1.clabel(CS1, CS1.levels[::2], inline=True, fmt=fmt, fontsize=10)
62+
ax1.clabel(CS1, CS1.levels[::2], fmt=fmt, fontsize=10)
6363

6464
# %%
6565
# Use a Formatter

‎galleries/examples/misc/demo_agg_filter.py

Copy file name to clipboardExpand all lines: galleries/examples/misc/demo_agg_filter.py
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,6 @@ def filtered_text(ax):
188188

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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.