Skip to content
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
8 changes: 4 additions & 4 deletions lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3958,15 +3958,15 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,

scales = s # Renamed for readability below.

# load default marker from rcParams
if marker is None:
marker = rcParams['scatter.marker']

# to be API compatible
if marker is None and not (verts is None):
marker = (verts, 0)
verts = None

# load default marker from rcParams
if marker is None:
marker = rcParams['scatter.marker']

if isinstance(marker, mmarkers.MarkerStyle):
marker_obj = marker
else:
Expand Down
Binary file modified lib/matplotlib/tests/baseline_images/test_axes/scatter_marker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 11 additions & 1 deletion lib/matplotlib/tests/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,7 @@ def test_scatter_plot():
@image_comparison(baseline_images=['scatter_marker'], remove_text=True,
extensions=['png'])
def test_scatter_marker():
fig, (ax0, ax1) = plt.subplots(ncols=2)
fig, (ax0, ax1, ax2) = plt.subplots(ncols=3)
ax0.scatter([3, 4, 2, 6], [2, 5, 2, 3],
c=[(1, 0, 0), 'y', 'b', 'lime'],
s=[60, 50, 40, 30],
Expand All @@ -1294,6 +1294,16 @@ def test_scatter_marker():
s=[60, 50, 40, 30],
edgecolors=['k', 'r', 'g', 'b'],
marker=mmarkers.MarkerStyle('o', fillstyle='top'))
# unit area ellipse
rx, ry = 3, 1
area = rx * ry * np.pi
theta = np.linspace(0, 2 * np.pi, 21)
verts = list(zip(np.cos(theta) * rx / area, np.sin(theta) * ry / area))
ax2.scatter([3, 4, 2, 6], [2, 5, 2, 3],
c=[(1, 0, 0), 'y', 'b', 'lime'],
s=[60, 50, 40, 30],
edgecolors=['k', 'r', 'g', 'b'],
verts=verts)


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