@@ -345,12 +345,16 @@ def makefill(x, y):
345345 seg = mpatches .Polygon (zip (x , y ),
346346 facecolor = facecolor ,
347347 fill = True ,
348+ closed = closed
348349 )
349350 self .set_patchprops (seg , ** kwargs )
350351 ret .append (seg )
351352
352- if self .command == 'plot' : func = makeline
353- else : func = makefill
353+ if self .command == 'plot' :
354+ func = makeline
355+ else :
356+ closed = kwargs .pop ("closed" )
357+ func = makefill
354358 if multicol :
355359 for j in range (y .shape [1 ]):
356360 func (x [:,j ], y [:,j ])
@@ -387,12 +391,16 @@ def makefill(x, y):
387391 seg = mpatches .Polygon (zip (x , y ),
388392 facecolor = facecolor ,
389393 fill = True ,
394+ closed = closed
390395 )
391396 self .set_patchprops (seg , ** kwargs )
392397 ret .append (seg )
393398
394- if self .command == 'plot' : func = makeline
395- else : func = makefill
399+ if self .command == 'plot' :
400+ func = makeline
401+ else :
402+ closed = kwargs .pop ('closed' )
403+ func = makefill
396404
397405 if multicol :
398406 for j in range (y .shape [1 ]):
@@ -4934,6 +4942,8 @@ def fill(self, *args, **kwargs):
49344942
49354943 See examples/fill_between.py for more examples.
49364944
4945+ The closed kwarg will close the polygon when True (default).
4946+
49374947 kwargs control the Polygon properties:
49384948 %(Polygon)s
49394949 """
@@ -5809,7 +5819,7 @@ def hist(self, x, bins=10, normed=False, cumulative=False,
58095819 x ,y = y ,x
58105820 elif orientation != 'vertical' :
58115821 raise ValueError , 'invalid orientation: %s' % orientation
5812- patches .append ( self .fill (x ,y ) )
5822+ patches .append ( self .fill (x ,y , closed = False ) )
58135823
58145824 # adopted from adjust_x/ylim part of the bar method
58155825 if orientation == 'horizontal' :
0 commit comments