Skip to content

Commit 8924ab8

Browse files
committed
Plot nothing for incompatible 0 shape in x,y data
1 parent d385b2c commit 8924ab8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/matplotlib/axes/_base.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,8 @@ def _plot_args(self, tup, kwargs, return_kwargs=False):
514514
ncx, ncy = x.shape[1], y.shape[1]
515515
if ncx > 1 and ncy > 1 and ncx != ncy:
516516
raise ValueError(f"x has {ncx} columns but y has {ncy} columns")
517+
if not ncx or not ncy:
518+
return []
517519

518520
label = kwargs.get('label')
519521
n_datasets = max(ncx, ncy)

0 commit comments

Comments
 (0)