html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue
https://github.com/pydata/xarray/issues/4702#issuecomment-747621248,https://api.github.com/repos/pydata/xarray/issues/4702,747621248,MDEyOklzc3VlQ29tbWVudDc0NzYyMTI0OA==,38358698,2020-12-17T18:35:13Z,2020-12-17T18:35:13Z,CONTRIBUTOR,"> Note that `da.plot(x=""lon"", y=""lat"")` and `da.plot(x=""lon"", y=""v"")` both work. So you have at least a workaround.
Yes. I didn't readily see that I needed to specify both `x` and `y`, partly because of the documentation and partly because I was deceived by the traceback. (Although `xr.core.utils.infix_dims()` raises the exception, `xr.plot.utils._infer_xy_labels()` causes the problem, and the responsible calls are separated by [tens of lines](https://github.com/pydata/xarray/blob/778a16ef392edd13cd14e1548700842e53e4656f/xarray/plot/plot.py#L670-L707) in `xr.plot.plot._plot2d()`.
> But yes I think it would be good to extend the logic to work when a non-dimension coordinate is passed.
I agree that, if *xarray* is going to guess, handling non-dimension coordinates would be an improvement. It might be specified to work only with 1-D coordinates and to do nothing for multi-dimensional coordinates.
Alternatively, is it at all preferable to remove the guessing feature? Although the behavior has been present for years, I found mention of it in the documentation only in ""What's New."" The motivating use case in #1290 could have been addressed instead simply with `z.transpose().plot()`, which the guessing causes under the hood anyway.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,769348008