Skip to content

Commit 7b97ae4

Browse files
committed
Document "." as a filled marker.
... which it really is. Also remove a bunch of unnecessary plt.show() from the marker reference example, to make it more convenient to run from the command line.
1 parent ecf2c88 commit 7b97ae4

File tree

3 files changed

+6
-17
lines changed

3 files changed

+6
-17
lines changed

examples/lines_bars_and_markers/marker_reference.py

-15
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ def split_list(a_list):
6060
ax.plot([y] * 3, marker=marker, **marker_style)
6161
format_axes(ax)
6262

63-
plt.show()
64-
65-
6663
###############################################################################
6764
# Filled markers
6865
# ==============
@@ -75,8 +72,6 @@ def split_list(a_list):
7572
ax.plot([y] * 3, marker=marker, **marker_style)
7673
format_axes(ax)
7774

78-
plt.show()
79-
8075
###############################################################################
8176
# .. _marker_fill_styles:
8277
#
@@ -102,9 +97,6 @@ def split_list(a_list):
10297
ax.plot([y] * 3, fillstyle=fill_style, **filled_marker_style)
10398
format_axes(ax)
10499

105-
plt.show()
106-
107-
108100
###############################################################################
109101
# Markers created from TeX symbols
110102
# ================================
@@ -128,9 +120,6 @@ def split_list(a_list):
128120
ax.plot([y] * 3, marker=marker, **marker_style)
129121
format_axes(ax)
130122

131-
plt.show()
132-
133-
134123
###############################################################################
135124
# Markers created from Paths
136125
# ==========================
@@ -160,8 +149,6 @@ def split_list(a_list):
160149
ax.plot([y] * 3, marker=marker, **marker_style)
161150
format_axes(ax)
162151

163-
plt.show()
164-
165152
###############################################################################
166153
# Advanced marker modifications with transform
167154
# ============================================
@@ -197,7 +184,6 @@ def split_list(a_list):
197184
format_axes(ax)
198185

199186
fig.tight_layout()
200-
plt.show()
201187

202188
###############################################################################
203189
# Setting marker cap style and join style
@@ -235,7 +221,6 @@ def split_list(a_list):
235221
ax.plot(x, y, marker=m, **marker_outer)
236222
ax.text(x, len(CapStyle) - .5, f'{theta}°', ha='center')
237223
format_axes(ax)
238-
plt.show()
239224

240225
###############################################################################
241226
# Modifying the join style:

lib/matplotlib/markers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ class MarkerStyle:
217217
# Just used for informational purposes. is_filled()
218218
# is calculated in the _set_* functions.
219219
filled_markers = (
220-
'o', 'v', '^', '<', '>', '8', 's', 'p', '*', 'h', 'H', 'D', 'd',
220+
'.', 'o', 'v', '^', '<', '>', '8', 's', 'p', '*', 'h', 'H', 'D', 'd',
221221
'P', 'X')
222222

223223
fillstyles = ('full', 'left', 'right', 'bottom', 'top', 'none')

lib/matplotlib/tests/test_lines.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,11 @@ def test_marker_fill_styles():
195195
x = np.array([0, 9])
196196
fig, ax = plt.subplots()
197197

198-
for j, marker in enumerate(mlines.Line2D.filled_markers):
198+
# This hard-coded list of markers correspond to an earlier iteration of
199+
# MarkerStyle.filled_markers; the value of that attribute has changed but
200+
# we kept the old value here to not regenerate the baseline image.
201+
# Replace with mlines.Line2D.filled_markers when the image is regenerated.
202+
for j, marker in enumerate("ov^<>8sp*hHDdPX"):
199203
for i, fs in enumerate(mlines.Line2D.fillStyles):
200204
color = next(colors)
201205
ax.plot(j * 10 + x, y + i + .5 * (j % 2),

0 commit comments

Comments
 (0)