Skip to content

Commit c9d75c0

Browse files
committed
Add rcParams support for markers' fillstyle prop
Signed-off-by: Niklas Koep <niklas.koep@gmail.com>
1 parent 28ccfa9 commit c9d75c0

File tree

4 files changed

+19
-9
lines changed

4 files changed

+19
-9
lines changed

lib/matplotlib/lines.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ def __init__(self, xdata, ydata,
256256
markeredgecolor=None,
257257
markerfacecolor=None,
258258
markerfacecoloralt='none',
259-
fillstyle='full',
259+
fillstyle=None,
260260
antialiased=None,
261261
dash_capstyle=None,
262262
solid_capstyle=None,

lib/matplotlib/markers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ class MarkerStyle(object):
145145
# TODO: Is this ever used as a non-constant?
146146
_point_size_reduction = 0.5
147147

148-
def __init__(self, marker=None, fillstyle='full'):
148+
def __init__(self, marker=None, fillstyle=None):
149149
"""
150150
MarkerStyle
151151
@@ -165,7 +165,6 @@ def __init__(self, marker=None, fillstyle='full'):
165165
fillstyle : string, optional, default: 'full'
166166
'full', 'left", 'right', 'bottom', 'top', 'none'
167167
"""
168-
self._fillstyle = fillstyle
169168
self.set_marker(marker)
170169
self.set_fillstyle(fillstyle)
171170

@@ -211,6 +210,8 @@ def set_fillstyle(self, fillstyle):
211210
----------
212211
fillstyle : string amongst known fillstyles
213212
"""
213+
if fillstyle is None:
214+
fillstyle = rcParams['markers.fillstyle']
214215
if fillstyle not in self.fillstyles:
215216
raise ValueError("Unrecognized fillstyle %s"
216217
% ' '.join(self.fillstyles))

lib/matplotlib/rcsetup.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,10 @@ def validate_ps_distiller(s):
392392
['butt', 'round', 'projecting'],
393393
ignorecase=True)
394394

395+
validate_fillstyle = ValidateInStrings('markers.fillstyle',
396+
['full', 'left', 'right', 'bottom',
397+
'top', 'none'])
398+
395399
validate_negative_linestyle = ValidateInStrings('negative_linestyle',
396400
['solid', 'dashed'],
397401
ignorecase=True)
@@ -552,6 +556,9 @@ def __call__(self, s):
552556
'lines.dash_capstyle': ['butt', validate_capstyle],
553557
'lines.solid_capstyle': ['projecting', validate_capstyle],
554558

559+
# marker props
560+
'markers.fillstyle': ['full', validate_fillstyle],
561+
555562
## patch props
556563
'patch.linewidth': [1.0, validate_float], # line width in points
557564
'patch.edgecolor': ['k', validate_color], # black

matplotlibrc.template

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ backend : %(backend)s
9090
#lines.solid_capstyle : projecting # butt|round|projecting
9191
#lines.antialiased : True # render lines in antialised (no jaggies)
9292

93+
#markers.fillstyle: full # full|left|right|bottom|top|none
94+
9395
### PATCHES
9496
# Patches are graphical objects that fill 2D space, like polygons or
9597
# circles. See
@@ -256,10 +258,10 @@ backend : %(backend)s
256258
# separator in the fr_FR locale.
257259
#axes.formatter.use_mathtext : False # When True, use mathtext for scientific
258260
# notation.
259-
#axes.formatter.useoffset : True # If True, the tick label formatter
260-
# will default to labeling ticks relative
261-
# to an offset when the data range is very
262-
# small compared to the minimum absolute
261+
#axes.formatter.useoffset : True # If True, the tick label formatter
262+
# will default to labeling ticks relative
263+
# to an offset when the data range is very
264+
# small compared to the minimum absolute
263265
# value of the data.
264266

265267
#axes.unicode_minus : True # use unicode for the minus symbol
@@ -410,7 +412,7 @@ backend : %(backend)s
410412
#savefig.jpeg_quality: 95 # when a jpeg is saved, the default quality parameter.
411413
#savefig.directory : ~ # default directory in savefig dialog box,
412414
# leave empty to always use current working directory
413-
#savefig.transparent : False # setting that controls whether figures are saved with a
415+
#savefig.transparent : False # setting that controls whether figures are saved with a
414416
# transparent background by default
415417

416418
# tk backend params
@@ -500,5 +502,5 @@ backend : %(backend)s
500502
# $PATH is searched
501503
#animation.mencoder_args: '' # Additional arguments to pass to mencoder
502504
#animation.convert_path: 'convert' # Path to ImageMagick's convert binary.
503-
# On Windows use the full path since convert
505+
# On Windows use the full path since convert
504506
# is also the name of a system tool.

0 commit comments

Comments
 (0)