Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d1ca0d4

Browse filesBrowse files
committed
Add markerfacecolor and markeredgecolor to the rcParams for lines
1 parent 575e013 commit d1ca0d4
Copy full SHA for d1ca0d4

File tree

Expand file treeCollapse file tree

5 files changed

+21
-0
lines changed
Filter options
Expand file treeCollapse file tree

5 files changed

+21
-0
lines changed

‎lib/matplotlib/lines.py

Copy file name to clipboardExpand all lines: lib/matplotlib/lines.py
+4Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,10 @@ def __init__(self, xdata, ydata,
326326
linestyle = rcParams['lines.linestyle']
327327
if marker is None:
328328
marker = rcParams['lines.marker']
329+
if markerfacecolor is None:
330+
markerfacecolor = rcParams['lines.markerfacecolor']
331+
if markeredgecolor is None:
332+
markeredgecolor = rcParams['lines.markeredgecolor']
329333
if color is None:
330334
color = rcParams['lines.color']
331335

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

Copy file name to clipboardExpand all lines: lib/matplotlib/mpl-data/stylelib/classic.mplstyle
+2Lines 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

Copy file name to clipboardExpand all lines: lib/matplotlib/rcsetup.py
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -946,6 +946,8 @@ def _validate_linestyle(ls):
946946
'lines.linestyle': ['-', _validate_linestyle], # solid line
947947
'lines.color': ['C0', validate_color], # first color in color cycle
948948
'lines.marker': ['None', validate_string], # marker name
949+
'lines.markerfacecolor': ['auto', validate_color_or_auto], # default color
950+
'lines.markeredgecolor': ['auto', validate_color_or_auto], # default color
949951
'lines.markeredgewidth': [1.0, validate_float],
950952
'lines.markersize': [6, validate_float], # markersize, in points
951953
'lines.antialiased': [True, validate_bool], # antialiased (no jaggies)

‎lib/matplotlib/tests/test_rcparams.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_rcparams.py
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,17 @@ def test_legend_colors(color_type, param_dict, target):
179179
leg = ax.legend()
180180
assert getattr(leg.legendPatch, get_func)() == target
181181

182+
def test_mfc_rcparams():
183+
mpl.rcParams['lines.markerfacecolor'] = 'r'
184+
ln = mpl.lines.Line2D([1, 2], [1, 2])
185+
assert ln.get_markerfacecolor() == 'r'
186+
187+
188+
def test_mec_rcparams():
189+
mpl.rcParams['lines.markeredgecolor'] = 'r'
190+
ln = mpl.lines.Line2D([1, 2], [1, 2])
191+
assert ln.get_markeredgecolor() == 'r'
192+
182193

183194
def test_Issue_1713():
184195
utf32_be = os.path.join(os.path.dirname(__file__),

‎matplotlibrc.template

Copy file name to clipboardExpand all lines: matplotlibrc.template
+2Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.