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

Skip to content

Commit 4a1d051

Browse files
committed
[3054467] fix bug in PatchCollection; restore attribute access to Patch.fill
svn path=/branches/v1_0_maint/; revision=8673
1 parent 76851eb commit 4a1d051

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

lib/matplotlib/collections.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,7 @@ def __init__(self, patches, match_original=False, **kwargs):
10341034

10351035
if match_original:
10361036
def determine_facecolor(patch):
1037-
if patch.fill:
1037+
if patch.get_fill():
10381038
return patch.get_facecolor()
10391039
return [0, 0, 0, 0]
10401040

lib/matplotlib/patches.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,13 +312,18 @@ def set_fill(self, b):
312312
313313
ACCEPTS: [True | False]
314314
"""
315-
self._fill = b
315+
self._fill = bool(b)
316316
self.set_facecolor(self._original_facecolor)
317317

318318
def get_fill(self):
319319
'return whether fill is set'
320320
return self._fill
321321

322+
# Make fill a property so as to preserve the long-standing
323+
# but somewhat inconsistent behavior in which fill was an
324+
# attribute.
325+
fill = property(get_fill, set_fill)
326+
322327
def set_hatch(self, hatch):
323328
"""
324329
Set the hatching pattern

0 commit comments

Comments
 (0)