Fix scatter edgecolor for unfilled points · matplotlib/matplotlib@a27175f · GitHub
Skip to content

Commit a27175f

Browse files
committed
Fix scatter edgecolor for unfilled points
For unfilled markers, the edgecolor -- if specified -- has precedence over the facecolor. closes has2k1/plotnine#100
1 parent 49d5ced commit a27175f

3 files changed

Lines changed: 25 additions & 3 deletions

File tree

Lines changed: 6 additions & 0 deletions

lib/matplotlib/axes/_axes.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3873,8 +3873,8 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
38733873
If it is 'none', the patch boundary will not
38743874
be drawn.
38753875
3876-
For non-filled markers, the `edgecolors` kwarg
3877-
is ignored and forced to 'face' internally.
3876+
For non-filled markers , the `edgecolors` kwarg (if it is not
3877+
None, 'face' or 'none') dictates the color of the marker.
38783878
38793879
Returns
38803880
-------
@@ -4024,7 +4024,8 @@ def scatter(self, x, y, s=None, c=None, marker=None, cmap=None, norm=None,
40244024
path = marker_obj.get_path().transformed(
40254025
marker_obj.get_transform())
40264026
if not marker_obj.is_filled():
4027-
edgecolors = 'face'
4027+
if edgecolors is None:
4028+
edgecolors = 'face'
40284029
linewidths = rcParams['lines.linewidth']
40294030

40304031
offsets = np.column_stack([x, y])

lib/matplotlib/tests/test_axes.py

Lines changed: 15 additions & 0 deletions

0 commit comments

Comments
 (0)