FacetGrid map_dataarray usage? #7310
-
I am trying to use FacetGrid to plot a number of spatial fields, and then overlay significance contours on them. <xarray.DataArray 'Z500' (mode: 2, region: 7, index_val: 2, lat: 91, lon: 360)>
Where I am storing the field values in mode='C', and the boolean significance test in mode='S'. I tried the following approach:
However this fails on the third line with the error: This is a result of the following attempt to access a 'dims' attribut which is just an empty list:
Can anyone tell me how to make this work? Full stack trace:
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hi Josh! I'm not sure what is happening here, but it could potentially be a bug, as normally we try to give more informative errors than the one you are seeing.
This should only be the case for scalar data, and presumably you don't intend to only have one scalar value per pcolormesh plot? I'm not sure if that's because of a problem with your input or our code though. If you could provide a minimal reproducible example (doesn't need to use your real data) it would make it much easier for us to help you debug this. |
Beta Was this translation helpful? Give feedback.
-
Hi Tom, hope you're well!
|
Beta Was this translation helpful? Give feedback.
-
There may perhaps be a small bug anyway, as DataArrays with and without coords are handled differently. Contrast:
with:
|
Beta Was this translation helpful? Give feedback.
Hi Tom, hope you're well!
I realise now I was making a basic error, and misinterpreting the keyword arguments. For posterity: