Skip to content

Commit 4ed01d7

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

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
@@ -356,6 +356,10 @@ def validate_ps_distiller(s):
356356
['butt', 'round', 'projecting'],
357357
ignorecase=True)
358358

359+
validate_fillstyle = ValidateInStrings('markers.fillstyle',
360+
['full', 'left', 'right', 'bottom',
361+
'top', 'none'])
362+
359363
validate_negative_linestyle = ValidateInStrings('negative_linestyle',
360364
['solid', 'dashed'],
361365
ignorecase=True)
@@ -509,6 +513,9 @@ def __call__(self, s):
509513
'lines.dash_capstyle': ['butt', validate_capstyle],
510514
'lines.solid_capstyle': ['projecting', validate_capstyle],
511515

516+
# marker props
517+
'markers.fillstyle': ['full', validate_fillstyle],
518+
512519
## patch props
513520
'patch.linewidth': [1.0, validate_float], # line width in points
514521
'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
@@ -255,10 +257,10 @@ backend : %(backend)s
255257
# separator in the fr_FR locale.
256258
#axes.formatter.use_mathtext : False # When True, use mathtext for scientific
257259
# notation.
258-
#axes.formatter.useoffset : True # If True, the tick label formatter
259-
# will default to labeling ticks relative
260-
# to an offset when the data range is very
261-
# small compared to the minimum absolute
260+
#axes.formatter.useoffset : True # If True, the tick label formatter
261+
# will default to labeling ticks relative
262+
# to an offset when the data range is very
263+
# small compared to the minimum absolute
262264
# value of the data.
263265

264266
#axes.unicode_minus : True # use unicode for the minus symbol
@@ -399,7 +401,7 @@ backend : %(backend)s
399401
#savefig.jpeg_quality: 95 # when a jpeg is saved, the default quality parameter.
400402
#savefig.directory : ~ # default directory in savefig dialog box,
401403
# leave empty to always use current working directory
402-
#savefig.transparent : False # setting that controls whether figures are saved with a
404+
#savefig.transparent : False # setting that controls whether figures are saved with a
403405
# transparent background by default
404406

405407
# tk backend params
@@ -489,5 +491,5 @@ backend : %(backend)s
489491
# $PATH is searched
490492
#animation.mencoder_args: '' # Additional arguments to pass to mencoder
491493
#animation.convert_path: 'convert' # Path to ImageMagick's convert binary.
492-
# On Windows use the full path since convert
494+
# On Windows use the full path since convert
493495
# is also the name of a system tool.

0 commit comments

Comments
 (0)