We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1d9783b commit a537aaaCopy full SHA for a537aaa
lib/matplotlib/axes/_axes.py
@@ -6142,6 +6142,16 @@ def _normalize_input(inp, ename='input'):
6142
if len(w) != nx:
6143
raise ValueError('weights should have the same shape as x')
6144
6145
+ # Masking invalid data:
6146
+ # Where an element of x[i] is invalid (NaN or inf), it and the
6147
+ # corresponding element of weights[i] (if weights used) will be masked.
6148
+ for i in range(len(x)):
6149
+ xi_mask = np.ma.masked_invalid(x[i]).mask
6150
+ x[i] = np.ma.masked_array(x[i], mask=xi_mask).compressed()
6151
+ if weights[i]:
6152
+ weights[i] = np.ma.masked_array(
6153
+ weights[i], mask=xi_mask).compressed()
6154
+
6155
for xi, wi in zip(x, w):
6156
if wi is not None and len(wi) != len(xi):
6157
raise ValueError(
0 commit comments