FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Implemented fix to issue 196 on github for log=True and histtype='step' by keflavich · Pull Request #1029 · matplotlib/matplotlib · GitHub

Repository navigation

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
14 changes: 13 additions & 1 deletion lib/matplotlib/axes.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -7861,7 +7861,19 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None,

x[0::2], x[1::2] = bins, bins

minimum = min(bins)
if log:
# setting a minimum of 0 results in problems for log plots
if normed:
# for normed data, set to 0.1 * minimum data value
# (gives 1 full dex for the lowest filled bin)
ndata = np.array(n)
minimum = (ndata[ndata>0].min())*0.1
else:
# for non-normed data, set the min to 0.1, again so that
# there is 1 full dex for the lowest bin
minimum = 0.1
else:
minimum = min(bins)

if align == 'left' or align == 'center':
x -= 0.5*(bins[1]-bins[0])
Expand Down

Back | FazBrowse Home | New Git URL