8000 Merge pull request #11099 from anntzer/markerstyles · matplotlib/matplotlib@c50273b · GitHub
[go: up one dir, main page]

Skip to content

Commit c50273b

Browse files
authored
Merge pull request #11099 from anntzer/markerstyles
Deprecate certain marker styles that have simpler synonyms.
2 parents 87f8599 + 6cfa0b9 commit c50273b

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Deprecation of certain marker styles
2+
````````````````````````````````````
3+
4+
Using ``(n, 3)`` as marker style to specify a circle marker is deprecated. Use
5+
``"o"`` instead.
6+
7+
Using ``([(x0, y0), (x1, y1), ...], 0)`` as marker style to specify a custom
8+
marker path is deprecated. Use ``[(x0, y0), (x1, y1), ...]`` instead.

examples/api/scatter_piecharts.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@
3838
s3 = np.abs(xy3).max()
3939

4040
fig, ax = plt.subplots()
41-
ax.scatter(range(3), range(3), marker=(xy1, 0),
41+
ax.scatter(range(3), range(3), marker=xy1,
4242
s=s1 ** 2 * sizes, facecolor='blue')
43-
ax.scatter(range(3), range(3), marker=(xy2, 0),
43+
ax.scatter(range(3), range(3), marker=xy2,
4444
s=s2 ** 2 * sizes, facecolor='green')
45-
ax.scatter(range(3), range(3), marker=(xy3, 0),
45+
ax.scatter(range(3), range(3), marker=xy3,
4646
s=s3 ** 2 * sizes, facecolor='red')
4747

4848
plt.show()

lib/matplotlib/markers.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,15 @@
6868
an asterisk
6969
3
7070
a circle (`numsides` and `angle` is
71-
ignored)
71+
ignored); deprecated.
7272
7373
`angle`:
7474
the angle of rotation of the symbol
7575
============================== ===============================================
7676
77-
For backward compatibility, the form (`verts`, 0) is also accepted,
78-
but it is equivalent to just `verts` for giving a raw set of vertices
79-
that define the shape.
77+
For backward compatibility, the form (`verts`, 0) is also accepted, but it is
78+
deprecated and equivalent to just `verts` for giving a raw set of vertices that
79+
define the shape.
8080
8181
`None` is the default which means 'nothing', however this table is
8282
referred to from other docs for the valid inputs from marker inputs and in
@@ -307,9 +307,17 @@ def _set_tuple_marker(self):
307307
self._filled = False
308308
self._joinstyle = 'bevel'
309309
elif symstyle == 3:
310+
cbook.warn_deprecated(
311+
"3.0", "Setting a circle marker using `(..., 3)` is "
312+
"deprecated since Matplotlib 3.0, and support for it will "
313+
"be removed in 3.2. Directly pass 'o' instead.")
310314
self._path = Path.unit_circle()
311315
self._transform = Affine2D().scale(0.5).rotate_deg(rotation)
312316
else:
317+
cbook.warn_deprecated(
318+
"3.0", "Passing vertices as `(verts, 0)` is deprecated since "
319+
"Matplotlib 3.0, and support for it will be removed in 3.2. "
320+
"Directly pass `verts` instead.")
313321
verts = np.asarray(marker[0])
314322
path = Path(verts)
315323
self._set_custom_marker(path)

0 commit comments

Comments
 (0)
0