You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is somewhat a complement issue to the treatment of xarray non-dimensioned coordinates #5214 .
That issue concerned the behaviour non-dimensioned with auto-populated widgets. With good reason non-dimensioned coordinates are not treated as kdims in that case.
However I think it would still be very useful if they could be used with kdims when explicitely specified by a user. Consider the following example from the xarray docs:
In [65]: ds.coords
Out[65]:
Coordinates:
lat (x, y) float64 42.25 42.21 42.63 42.59
lon (x, y) float64 -99.83 -99.32 -99.79 -99.23
* time (time) datetime64[ns] 2014-09-06 2014-09-07 2014-09-08
reference_time datetime64[ns] 2014-09-05
day (time) int64 6 7 8
Here 'lat' and 'lon' are non-dimensioned coordinates, yet I would think that it makes sense to want to use them as kdims to a scatter plot or heatmap.
As another example, consider a simulation that has multiple variants of its time axis:
simulator step (int)
simulation time (float)
real-world time (float)
Only one of this can be a dimensioned coordinate in the DataArray, yet all of them could sensibly be used as a plotting axis.
Finally, it may be worth noting that plotting is one of the explicit intentions for non-dimensioned coordinates according to the docs I linked above.
This isn’t too bad (even though the vdim name needs to be repeated), but it still feels like xarray’s annotation abilities (here to specify alternative axes) are being wasted.
The text was updated successfully, but these errors were encountered:
This is somewhat a complement issue to the treatment of
xarray
non-dimensioned coordinates #5214 .That issue concerned the behaviour non-dimensioned with auto-populated widgets. With good reason non-dimensioned coordinates are not treated as kdims in that case.
However I think it would still be very useful if they could be used with
kdims
when explicitely specified by a user. Consider the following example from the xarray docs:Here
'lat'
and'lon'
are non-dimensioned coordinates, yet I would think that it makes sense to want to use them askdims
to a scatter plot or heatmap.As another example, consider a simulation that has multiple variants of its time axis:
Only one of this can be a dimensioned coordinate in the
DataArray
, yet all of them could sensibly be used as a plotting axis.Finally, it may be worth noting that plotting is one of the explicit intentions for non-dimensioned coordinates according to the docs I linked above.
Describe the solution you'd like
Given an xarray
DataArray
,it is very easy to plot using dimensioned coordinates as
kdims
:I would like the same to be true for non-dimensioned coordinates
Workaround
One approach that already works today is to first convert to a dataframe
This isn’t too bad (even though the vdim name needs to be repeated), but it still feels like
xarray
’s annotation abilities (here to specify alternative axes) are being wasted.The text was updated successfully, but these errors were encountered: