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 103d839

Browse filesBrowse files
authored
Merge pull request matplotlib#11267 from maahn/fixHistNan
FIX: allow nan values in data for plt.hist
2 parents ff67864 + 11cecfe commit 103d839
Copy full SHA for 103d839

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed

‎lib/matplotlib/axes/_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_axes.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6160,8 +6160,8 @@ def hist(self, x, bins=None, range=None, density=None, weights=None,
61606160
xmax = -np.inf
61616161
for xi in x:
61626162
if len(xi) > 0:
6163-
xmin = min(xmin, xi.min())
6164-
xmax = max(xmax, xi.max())
6163+
xmin = min(xmin, np.nanmin(xi))
6164+
xmax = max(xmax, np.nanmax(xi))
61656165
bin_range = (xmin, xmax)
61666166
density = bool(density) or bool(normed)
61676167
if density and not stacked:

0 commit comments

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