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

Skip to content

Commit 213459e

Browse files
author
Craig M
committed
first commit to allow fillstyle none
1 parent 2b70fce commit 213459e

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

lib/matplotlib/lines.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -305,9 +305,9 @@ def get_fillstyle(self):
305305
def set_fillstyle(self, fs):
306306
"""
307307
Set the marker fill style; 'full' means fill the whole marker.
308-
The other options are for half filled markers
308+
'none' means no filling; other options are for half-filled markers.
309309
310-
ACCEPTS: ['full' | 'left' | 'right' | 'bottom' | 'top']
310+
ACCEPTS: ['full' | 'left' | 'right' | 'bottom' | 'top' | 'none']
311311
"""
312312
self._marker.set_fillstyle(fs)
313313

@@ -585,10 +585,11 @@ def _get_markerfacecolor(self, alt=False):
585585
else:
586586
fc = self._markerfacecolor
587587

588-
if (fc is None or (is_string_like(fc) and fc.lower()=='none') ):
589-
return fc
590-
elif (is_string_like(fc) and fc.lower() == 'auto'):
591-
return self._color
588+
if (is_string_like(fc) and fc.lower() == 'auto'):
589+
if self.get_fillstyle() == 'none':
590+
return 'none'
591+
else:
592+
return self._color
592593
else:
593594
return fc
594595

lib/matplotlib/markers.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,12 @@ class MarkerStyle:
101101
filled_markers = (
102102
'o', 'v', '^', '<', '>', '8', 's', 'p', '*', 'h', 'H', 'D', 'd')
103103

104-
fillstyles = ('full', 'left' , 'right' , 'bottom' , 'top')
104+
fillstyles = ('full', 'left' , 'right' , 'bottom' , 'top', 'none')
105105

106106
# TODO: Is this ever used as a non-constant?
107107
_point_size_reduction = 0.5
108108

109109
def __init__(self, marker=None, fillstyle='full'):
110-
self._fillstyle = fillstyle
111110
self.set_marker(marker)
112111
self.set_fillstyle(fillstyle)
113112

@@ -329,7 +328,7 @@ def _set_square(self):
329328
self._transform = Affine2D().translate(-0.5, -0.5)
330329
self._snap_threshold = 2.0
331330
fs = self.get_fillstyle()
332-
if fs=='full':
331+
if fs == 'full' or fs == 'none':
333332
self._path = Path.unit_rectangle()
334333
else:
335334
# build a bottom filled square out of two rectangles, one
@@ -349,7 +348,7 @@ def _set_diamond(self):
349348
self._transform = Affine2D().translate(-0.5, -0.5).rotate_deg(45)
350349
self._snap_threshold = 5.0
351350
fs = self.get_fillstyle()
352-
if fs=='full':
351+
if fs == 'full' or fs == 'none':
353352
self._path = Path.unit_rectangle()
354353
else:
355354
self._path = Path([[0.0, 0.0], [1.0, 0.0], [1.0, 1.0], [0.0, 0.0]])
@@ -374,7 +373,7 @@ def _set_pentagon(self):
374373
polypath = Path.unit_regular_polygon(5)
375374
fs = self.get_fillstyle()
376375

377-
if fs == 'full':
376+
if fs == 'full' or fs == 'none':
378377
self._path = polypath
379378
else:
380379
verts = polypath.vertices
@@ -404,7 +403,7 @@ def _set_star(self):
404403
fs = self.get_fillstyle()
405404
polypath = Path.unit_regular_star(5, innerCircle=0.381966)
406405

407-
if fs == 'full':
406+
if fs == 'full' or fs == 'none':
408407
self._path = polypath
409408
else:
410409
verts = polypath.vertices
@@ -433,7 +432,7 @@ def _set_hexagon1(self):
433432
fs = self.get_fillstyle()
434433
polypath = Path.unit_regular_polygon(6)
435434

436-
if fs == 'full':
435+
if fs == 'full' or fs == 'none':
437436
self._path = polypath
438437
else:
439438
verts = polypath.vertices
@@ -465,7 +464,7 @@ def _set_hexagon2(self):
465464
fs = self.get_fillstyle()
466465
polypath = Path.unit_regular_polygon(6)
467466

468-
if fs == 'full':
467+
if fs == 'full' or fs == 'none':
469468
self._path = polypath
470469
else:
471470
verts = polypath.vertices
@@ -497,7 +496,7 @@ def _set_octagon(self):
497496
fs = self.get_fillstyle()
498497
polypath = Path.unit_regular_polygon(8)
499498

500-
if fs == 'full':
499+
if fs == 'full' or fs == 'none':
501500
self._transform.rotate_deg(22.5)
502501
self._path = polypath
503502
else:

0 commit comments

Comments
 (0)