Skip to content

Commit 912f9b6

Browse files
authored
Merge pull request matplotlib#8479 from kalagau/TeamDoItTomorrow3923
[MRG+1] FIX markerfacecolor / mfc not in rcparams
2 parents 1c5eaf6 + 1d9880c commit 912f9b6

File tree

5 files changed

+22
-0
lines changed

5 files changed

+22
-0
lines changed

lib/matplotlib/lines.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,10 @@ def __init__(self, xdata, ydata,
333333
linestyle = rcParams['lines.linestyle']
334334
if marker is None:
335335
marker = rcParams['lines.marker']
336+
if markerfacecolor is None:
337+
markerfacecolor = rcParams['lines.markerfacecolor']
338+
if markeredgecolor is None:
339+
markeredgecolor = rcParams['lines.markeredgecolor']
336340
if color is None:
337341
color = rcParams['lines.color']
338342

lib/matplotlib/mpl-data/stylelib/classic.mplstyle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ lines.linewidth : 1.0 # line width in points
88
lines.linestyle : - # solid line
99
lines.color : b # has no affect on plot(); see axes.prop_cycle
1010
lines.marker : None # the default marker
11+
lines.markerfacecolor : auto # the default markerfacecolor
12+
lines.markeredgecolor : auto # the default markeredgecolor
1113
lines.markeredgewidth : 0.5 # the line width around the marker symbol
1214
lines.markersize : 6 # markersize, in points
1315
lines.dash_joinstyle : round # miter|round|bevel

lib/matplotlib/rcsetup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1008,6 +1008,8 @@ def _validate_linestyle(ls):
10081008
'lines.linestyle': ['-', _validate_linestyle], # solid line
10091009
'lines.color': ['C0', validate_color], # first color in color cycle
10101010
'lines.marker': ['None', validate_string], # marker name
1011+
'lines.markerfacecolor': ['auto', validate_color_or_auto], # default color
1012+
'lines.markeredgecolor': ['auto', validate_color_or_auto], # default color
10111013
'lines.markeredgewidth': [1.0, validate_float],
10121014
'lines.markersize': [6, validate_float], # markersize, in points
10131015
'lines.antialiased': [True, validate_bool], # antialiased (no jaggies)

lib/matplotlib/tests/test_rcparams.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,18 @@ def test_legend_colors(color_type, param_dict, target):
181181
assert getattr(leg.legendPatch, get_func)() == target
182182

183183

184+
def test_mfc_rcparams():
185+
mpl.rcParams['lines.markerfacecolor'] = 'r'
186+
ln = mpl.lines.Line2D([1, 2], [1, 2])
187+
assert ln.get_markerfacecolor() == 'r'
188+
189+
190+
def test_mec_rcparams():
191+
mpl.rcParams['lines.markeredgecolor'] = 'r'
192+
ln = mpl.lines.Line2D([1, 2], [1, 2])
193+
assert ln.get_markeredgecolor() == 'r'
194+
195+
184196
def test_Issue_1713():
185197
utf32_be = os.path.join(os.path.dirname(__file__),
186198
'test_utf32_be_rcparams.rc')

matplotlibrc.template

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ backend : $TEMPLATE_BACKEND
7878
#lines.linestyle : - ## solid line
7979
#lines.color : C0 ## has no affect on plot(); see axes.prop_cycle
8080
#lines.marker : None ## the default marker
81+
#lines.markerfacecolor : auto ## the default markerfacecolor
82+
#lines.markeredgecolor : auto ## the default markeredgecolor
8183
#lines.markeredgewidth : 1.0 ## the line width around the marker symbol
8284
#lines.markersize : 6 ## markersize, in points
8385
#lines.dash_joinstyle : round ## miter|round|bevel

0 commit comments

Comments
 (0)