Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 54ec514

Browse filesBrowse files
Axes.hist: use bottom for minimum if > 0
1 parent 545c2a0 commit 54ec514
Copy full SHA for 54ec514

File tree

Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-1
lines changed

‎lib/matplotlib/axes/_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_axes.py
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5909,7 +5909,9 @@ def hist(self, x, bins=10, range=None, normed=False, weights=None,
59095909
logbase = self.yaxis._scale.base
59105910

59115911
# Setting a minimum of 0 results in problems for log plots
5912-
if normed or weights is not None:
5912+
if np.min(bottom) > 0:
5913+
minimum = np.min(bottom)
5914+
elif normed or weights is not None:
59135915
# For normed data, set to log base * minimum data value
59145916
# (gives 1 full tick-label unit for the lowest filled bin)
59155917
ndata = np.array(n)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.