Skip to content

Commit e7172a4

Browse files
committed
make hist histype='step' return list of container instead list of list
so that the last return value of hist can be used in legend consistently between 'bar' and 'step'
1 parent bbe1053 commit e7172a4

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/matplotlib/axes.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
import matplotlib.transforms as mtransforms
3737
import matplotlib.tri as mtri
3838

39-
from matplotlib.container import BarContainer, ErrorbarContainer, StemContainer
39+
from matplotlib.container import Container, BarContainer, ErrorbarContainer, StemContainer
4040

4141
iterable = cbook.iterable
4242
is_string_like = cbook.is_string_like
@@ -7868,11 +7868,11 @@ def hist(x, bins=10, range=None, normed=False, weights=None,
78687868
x,y = y,x
78697869

78707870
if fill:
7871-
patches.append( self.fill(x, y,
7872-
closed=False, facecolor=c) )
7871+
patches.append( Container(self.fill(x, y,
7872+
closed=False, facecolor=c)) )
78737873
else:
7874-
patches.append( self.fill(x, y,
7875-
closed=False, edgecolor=c, fill=False) )
7874+
patches.append( Container(self.fill(x, y,
7875+
closed=False, edgecolor=c, fill=False)) )
78767876

78777877
# adopted from adjust_x/ylim part of the bar method
78787878
if orientation == 'horizontal':

0 commit comments

Comments
 (0)