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 2b34931

Browse filesBrowse files
committed
Deprecate the verts kwarg to scatter.
The `marker` kwarg is completely compatible and more general.
1 parent 6665bc7 commit 2b34931
Copy full SHA for 2b34931

File tree

Expand file treeCollapse file tree

5 files changed

+11
-13
lines changed
Filter options
Expand file treeCollapse file tree

5 files changed

+11
-13
lines changed

‎doc/api/next_api_changes/2018-02-15-AL-deprecations.rst

Copy file name to clipboardExpand all lines: doc/api/next_api_changes/2018-02-15-AL-deprecations.rst
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,6 @@ The following classes, methods, functions, and attributes are deprecated:
4040

4141
The following rcParams are deprecated:
4242
- ``pgf.debug`` (the pgf backend relies on logging),
43+
44+
The following keyword arguments are deprecated:
45+
- passing ``verts`` to ``scatter`` (use ``marker`` instead),

‎examples/lines_bars_and_markers/scatter_custom_symbol.py

Copy file name to clipboardExpand all lines: examples/lines_bars_and_markers/scatter_custom_symbol.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
s *= 10**2.
2020

2121
fig, ax = plt.subplots()
22-
ax.scatter(x, y, s, c, marker=None, verts=verts)
22+
ax.scatter(x, y, s, c, marker=verts)
2323

2424
plt.show()

‎examples/lines_bars_and_markers/scatter_star_poly.py

Copy file name to clipboardExpand all lines: examples/lines_bars_and_markers/scatter_star_poly.py
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@
2626

2727
verts = np.array([[-1, -1], [1, -1], [1, 1], [-1, -1]])
2828
plt.subplot(323)
29-
plt.scatter(x, y, s=80, c=z, marker=(verts, 0))
30-
# equivalent:
31-
# plt.scatter(x, y, s=80, c=z, marker=None, verts=verts)
29+
plt.scatter(x, y, s=80, c=z, marker=verts)
3230

3331
plt.subplot(324)
3432
plt.scatter(x, y, s=80, c=z, marker=(5, 1))

‎lib/matplotlib/axes/_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_axes.py
+5-8Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3818,11 +3818,6 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
38183818
is 'face'. You may want to change this as well.
38193819
If *None*, defaults to rcParams ``lines.linewidth``.
38203820
3821-
verts : sequence of (x, y), optional
3822-
If *marker* is *None*, these vertices will be used to construct
3823-
the marker. The center of the marker is located at (0, 0) in
3824-
normalized units. The overall marker is rescaled by *s*.
3825-
38263821
edgecolors : color or sequence of color, optional, default: 'face'
38273822
The edge color of the marker. Possible values:
38283823
@@ -3960,9 +3955,11 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
39603955
scales = s # Renamed for readability below.
39613956

39623957
# to be API compatible
3963-
if marker is None and verts is not None:
3964-
marker = (verts, 0)
3965-
verts = None
3958+
if verts is not None:
3959+
cbook.warn_deprecated("3.0", name="'verts'", obj_type="kwarg",
3960+
alternative="'marker'")
3961+
if marker is None:
3962+
marker = verts
39663963

39673964
# load default marker from rcParams
39683965
if marker is None:

‎lib/matplotlib/tests/test_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1743,7 +1743,7 @@ def test_scatter_marker():
17431743
c=[(1, 0, 0), 'y', 'b', 'lime'],
17441744
s=[60, 50, 40, 30],
17451745
edgecolors=['k', 'r', 'g', 'b'],
1746-
verts=verts)
1746+
marker=verts)
17471747

17481748

17491749
@image_comparison(baseline_images=['scatter_2D'], remove_text=True,

0 commit comments

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