Skip to content

Commit 4288379

Browse files
committed
Raise exception in multiple data groups case
1 parent 6bbd04e commit 4288379

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,10 @@ def __call__(self, *args, data=None, **kwargs):
293293
replaced[label_namer_idx], args[label_namer_idx])
294294
args = replaced
295295

296+
if len(args) >= 4 and not cbook.is_scalar_or_string(kwargs["label"]):
297+
raise ValueError("plot() with multiple groups of data (i.e., pairs "
298+
"of x and y) does not support multiple labels")
299+
296300
# Repeatedly grab (x, y) or (x, y, format) from the front of args and
297301
# massage them into arguments to plot() or fill().
298302

0 commit comments

Comments
 (0)