diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 251cc32f362a..47b5aaeab493 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -4392,9 +4392,8 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None, - 'none': No patch boundary will be drawn. - A color or sequence of colors. - For non-filled markers, *edgecolors* is ignored. Instead, the color - is determined like with 'face', i.e. from *c*, *colors*, or - *facecolors*. + For non-filled markers, the *edgecolors* kwarg is ignored and + forced to 'face' internally. plotnonfinite : bool, default: False Set to plot points with nonfinite *c*, in conjunction with @@ -4476,6 +4475,7 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None, path = marker_obj.get_path().transformed( marker_obj.get_transform()) if not marker_obj.is_filled(): + edgecolors = 'face' if linewidths is None: linewidths = rcParams['lines.linewidth'] elif np.iterable(linewidths): @@ -4487,8 +4487,8 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None, collection = mcoll.PathCollection( (path,), scales, - facecolors=colors if marker_obj.is_filled() else 'none', - edgecolors=edgecolors if marker_obj.is_filled() else colors, + facecolors=colors, + edgecolors=edgecolors, linewidths=linewidths, offsets=offsets, transOffset=kwargs.pop('transform', self.transData), diff --git a/lib/matplotlib/markers.py b/lib/matplotlib/markers.py index ed3d3b18583a..17747c69b62f 100644 --- a/lib/matplotlib/markers.py +++ b/lib/matplotlib/markers.py @@ -237,10 +237,7 @@ def _recache(self): self._snap_threshold = None self._joinstyle = 'round' self._capstyle = 'butt' - # Initial guess: Assume the marker is filled unless the fillstyle is - # set to 'none'. The marker function will override this for unfilled - # markers. - self._filled = self._fillstyle != 'none' + self._filled = True self._marker_function() def __bool__(self): diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py index 1d50b1bf2cf0..ae144b607afa 100644 --- a/lib/matplotlib/tests/test_axes.py +++ b/lib/matplotlib/tests/test_axes.py @@ -1855,16 +1855,6 @@ def test_scatter_color(self): with pytest.raises(ValueError): plt.scatter([1, 2, 3], [1, 2, 3], color=[1, 2, 3]) - def test_scatter_unfilled(self): - coll = plt.scatter([0, 1, 2], [1, 3, 2], c=['0.1', '0.3', '0.5'], - marker=mmarkers.MarkerStyle('o', fillstyle='none'), - linewidths=[1.1, 1.2, 1.3]) - assert coll.get_facecolors().shape == (0, 4) # no facecolors - assert_array_equal(coll.get_edgecolors(), [[0.1, 0.1, 0.1, 1], - [0.3, 0.3, 0.3, 1], - [0.5, 0.5, 0.5, 1]]) - assert_array_equal(coll.get_linewidths(), [1.1, 1.2, 1.3]) - def test_scatter_size_arg_size(self): x = np.arange(4) with pytest.raises(ValueError): diff --git a/lib/matplotlib/tests/test_marker.py b/lib/matplotlib/tests/test_marker.py index 1ac7aaa0d0d8..80d0084affd6 100644 --- a/lib/matplotlib/tests/test_marker.py +++ b/lib/matplotlib/tests/test_marker.py @@ -7,12 +7,6 @@ import pytest -def test_marker_fillstyle(): - marker_style = markers.MarkerStyle(marker='o', fillstyle='none') - assert marker_style.get_fillstyle() == 'none' - assert not marker_style.is_filled() - - def test_markers_valid(): marker_style = markers.MarkerStyle() mrk_array = np.array([[-0.5, 0],