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

Skip to content

Commit 581f1c1

Browse files
committed
fixed a bug for log-scale stacked histograms
svn path=/trunk/matplotlib/; revision=5354
1 parent e39c2e1 commit 581f1c1

2 files changed

Lines changed: 9 additions & 5 deletions

File tree

CHANGELOG

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
2008-06-02 Added support for log to hist with histtype='step' - MM
1+
2008-06-02 Added support for log to hist with histtype='step' and fixed
2+
a bug for log-scale stacked histograms - MM
23

34
===============================================================
45
2008-05-29 Released 0.98.0 at revision 5314

lib/matplotlib/axes.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5637,7 +5637,7 @@ def hist(self, x, bins=10, normed=False, cumulative=False,
56375637
56385638
align:
56395639
['edge' | 'center' ] Controles how the histogram is plotted.
5640-
If 'edge, bars are centered between the bin edges.
5640+
If 'edge', bars are centered between the bin edges.
56415641
If 'center', bars are centered on the left bin edges
56425642
56435643
orientation:
@@ -5718,7 +5718,6 @@ def hist(self, x, bins=10, normed=False, cumulative=False,
57185718
boffset, dw = 0.0, 0.0
57195719

57205720
stacked = True
5721-
if bottom is None: bottom = 0.0
57225721
else:
57235722
raise ValueError, 'invalid histtype: %s' % histtype
57245723

@@ -5734,7 +5733,9 @@ def hist(self, x, bins=10, normed=False, cumulative=False,
57345733
left=bottom, align='center', log=log,
57355734
color=color)
57365735
patches.append(patch)
5737-
if stacked: bottom += m
5736+
if stacked:
5737+
if bottom is None: bottom = 0.0
5738+
bottom += m
57385739
boffset += dw
57395740
ccount += 1
57405741
elif orientation == 'vertical':
@@ -5744,7 +5745,9 @@ def hist(self, x, bins=10, normed=False, cumulative=False,
57445745
bottom=bottom, align='center', log=log,
57455746
color=color)
57465747
patches.append(patch)
5747-
if stacked: bottom += m
5748+
if stacked:
5749+
if bottom is None: bottom = 0.0
5750+
bottom += m
57485751
boffset += dw
57495752
ccount += 1
57505753
else:

0 commit comments

Comments
 (0)