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

Skip to content

Commit de7bc93

Browse files
tacaswellmdboom
authored andcommitted
API: Line2D and scatter default to automatic
- for plot, the default marker edge is now the color of the marker - for scatter the marker edge color now follows the face color closes #4679
1 parent f88114c commit de7bc93

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3762,11 +3762,16 @@ def scatter(self, x, y, s=20, c=None, marker='o', cmap=None, norm=None,
37623762
If None, defaults to (lines.linewidth,).
37633763
37643764
edgecolors : color or sequence of color, optional, default: None
3765-
If None, defaults to (patch.edgecolor).
3765+
If None, defaults to 'face'
3766+
37663767
If 'face', the edge color will always be the same as
3767-
the face color. If it is 'none', the patch boundary will not
3768-
be drawn. For non-filled markers, the `edgecolors` kwarg
3769-
is ignored; color is determined by `c`.
3768+
the face color.
3769+
3770+
If it is 'none', the patch boundary will not
3771+
be drawn.
3772+
3773+
For non-filled markers, the `edgecolors` kwarg
3774+
is ignored and forced to 'face' internally.
37703775
37713776
Returns
37723777
-------
@@ -3823,6 +3828,9 @@ def scatter(self, x, y, s=20, c=None, marker='o', cmap=None, norm=None,
38233828
else:
38243829
c = 'b' # The original default
38253830

3831+
if edgecolors is None and not rcParams['_internal.classic_mode']:
3832+
edgecolors = 'face'
3833+
38263834
self._process_unit_info(xdata=x, ydata=y, kwargs=kwargs)
38273835
x = self.convert_xunits(x)
38283836
y = self.convert_yunits(y)

lib/matplotlib/lines.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -849,12 +849,12 @@ def get_marker(self):
849849
def get_markeredgecolor(self):
850850
mec = self._markeredgecolor
851851
if (is_string_like(mec) and mec == 'auto'):
852-
if self._marker.get_marker() in ('.', ','):
853-
return self._color
854-
if self._marker.is_filled() and self.get_fillstyle() != 'none':
855-
return 'k' # Bad hard-wired default...
856-
else:
857-
return self._color
852+
if rcParams['_internal.classic_mode']:
853+
if self._marker.get_marker() in ('.', ','):
854+
return self._color
855+
if self._marker.is_filled() and self.get_fillstyle() != 'none':
856+
return 'k' # Bad hard-wired default...
857+
return self._color
858858
else:
859859
return mec
860860

0 commit comments

Comments
 (0)