Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 09068fd

Browse files
committed
Revert "Merge pull request #17543 from timhoffm/unfilled-markers"
This reverts commit 16ae71f, reversing changes made to 7a6c5d3.
1 parent e37eee1 commit 09068fd

File tree

4 files changed

+6
-25
lines changed

4 files changed

+6
-25
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4392,9 +4392,8 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
43924392
- 'none': No patch boundary will be drawn.
43934393
- A color or sequence of colors.
43944394
4395-
For non-filled markers, *edgecolors* is ignored. Instead, the color
4396-
is determined like with 'face', i.e. from *c*, *colors*, or
4397-
*facecolors*.
4395+
For non-filled markers, the *edgecolors* kwarg is ignored and
4396+
forced to 'face' internally.
43984397
43994398
plotnonfinite : bool, default: False
44004399
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,
44764475
path = marker_obj.get_path().transformed(
44774476
marker_obj.get_transform())
44784477
if not marker_obj.is_filled():
4478+
edgecolors = 'face'
44794479
if linewidths is None:
44804480
linewidths = rcParams['lines.linewidth']
44814481
elif np.iterable(linewidths):
@@ -4487,8 +4487,8 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
44874487

44884488
collection = mcoll.PathCollection(
44894489
(path,), scales,
4490-
facecolors=colors if marker_obj.is_filled() else 'none',
4491-
edgecolors=edgecolors if marker_obj.is_filled() else colors,
4490+
facecolors=colors,
4491+
edgecolors=edgecolors,
44924492
linewidths=linewidths,
44934493
offsets=offsets,
44944494
transOffset=kwargs.pop('transform', self.transData),

lib/matplotlib/markers.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,7 @@ def _recache(self):
237237
self._snap_threshold = None
238238
self._joinstyle = 'round'
239239
self._capstyle = 'butt'
240-
# Initial guess: Assume the marker is filled unless the fillstyle is
241-
# set to 'none'. The marker function will override this for unfilled
242-
# markers.
243-
self._filled = self._fillstyle != 'none'
240+
self._filled = True
244241
self._marker_function()
245242

246243
def __bool__(self):

lib/matplotlib/tests/test_axes.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1855,16 +1855,6 @@ def test_scatter_color(self):
18551855
with pytest.raises(ValueError):
18561856
plt.scatter([1, 2, 3], [1, 2, 3], color=[1, 2, 3])
18571857

1858-
def test_scatter_unfilled(self):
1859-
coll = plt.scatter([0, 1, 2], [1, 3, 2], c=['0.1', '0.3', '0.5'],
1860-
marker=mmarkers.MarkerStyle('o', fillstyle='none'),
1861-
linewidths=[1.1, 1.2, 1.3])
1862-
assert coll.get_facecolors().shape == (0, 4) # no facecolors
1863-
assert_array_equal(coll.get_edgecolors(), [[0.1, 0.1, 0.1, 1],
1864-
[0.3, 0.3, 0.3, 1],
1865-
[0.5, 0.5, 0.5, 1]])
1866-
assert_array_equal(coll.get_linewidths(), [1.1, 1.2, 1.3])
1867-
18681858
def test_scatter_size_arg_size(self):
18691859
x = np.arange(4)
18701860
with pytest.raises(ValueError):

lib/matplotlib/tests/test_marker.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@
77
import pytest
88

99

10-
def test_marker_fillstyle():
11-
marker_style = markers.MarkerStyle(marker='o', fillstyle='none')
12-
assert marker_style.get_fillstyle() == 'none'
13-
assert not marker_style.is_filled()
14-
15-
1610
def test_markers_valid():
1711
marker_style = markers.MarkerStyle()
1812
mrk_array = np.array([[-0.5, 0],

0 commit comments

Comments
 (0)