8000 Skip masking for empty x. · matplotlib/matplotlib@da16535 · GitHub
[go: up one dir, main page]

Skip to content

Commit da16535

Browse files
committed
Skip masking for empty x.
1 parent 4296136 commit da16535

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6149,12 +6149,13 @@ def _normalize_input(inp, ename='input'):
61496149

61506150
# Combine the masks from x[i] and w[i] (if applicable) into a single
61516151
# mask and apply it to both.
6152-
for i in range(len(x)):
6153-
mask_i = x[i].mask
6154-
if w[i] is not None:
6155-
mask_i = mask_i & w[i].mask
6156-
w[i] = np.ma.masked_array(w[i], mask=mask_i).compressed()
6157-
x[i] = np.ma.masked_array(x[i], mask=mask_i).compressed()
6152+
if not input_empty:
6153+
for i in range(len(x)):
6154+
mask_i = x[i].mask
6155+
if w[i] is not None:
6156+
mask_i = mask_i & w[i].mask
6157+
w[i] = np.ma.masked_array(w[i], mask=mask_i).compressed()
6158+
x[i] = np.ma.masked_array(x[i], mask=mask_i).compressed()
61586159

61596160
if color is None:
61606161
color = [self._get_lines.get_next_color() for i in xrange(nx)]

0 commit comments

Comments
 (0)
0