Skip to content

Commit fabdc04

Browse files
author
dcherian
committed
Try again
1 parent 56d4d3f commit fabdc04

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

xarray/plot/plot.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,13 @@ def line(darray, *args, **kwargs):
204204

205205
ax = get_axis(figsize, size, aspect, ax)
206206

207-
error_msg = 'must be either None or one of %r' % list(darray.dims)
207+
error_msg = ('must be either None or one of ({0:s})'
208+
.format(', '.join(['\'' + dd + '\'' for dd in darray.dims])))
208209

209-
if x not in [None, *darray.dims]:
210+
if x is not None and x not in darray.dims:
210211
raise ValueError('x ' + error_msg)
211212

212-
if y not in [None, *darray.dims]:
213+
if y is not None and y not in darray.dims:
213214
raise ValueError('y ' + error_msg)
214215

215216
if x is not None and y is not None:

0 commit comments

Comments
 (0)