Closed mgorfer closed 1 year ago
It should probably be documented somewhere but hv.Image and hv.QuadMesh are defined as a binned 2D continuous space so using them for categorical values does not make sense. At minimum that should raise a better error. A HeatMap on the other hand is defined as a purely categorical element. Currently there is no mixed heatmap/raster like element that supports one continuous and one categorical axis, however we have plans for Raster
to support this.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
I import a DataArray from xarray and create a hv.Dataset
:Dataset [x,y] (z)
. The dimension x is a categorical axis and y is a default linear axis. Depending on thehv.element
I am using this is either working as expected (forhv.Scatter, hv.Curve, hv.Bar
), or I get the errorTypeError: unsupported operand type(s) for -: 'str' and 'str'
(forhv.QuadMesh, hv.Image, hv.HeatMap
).To get the result I want in a hv.QuadMesh, first in xarray I change the categorical x-axis to a linear axis
x =[0,1,2]
. Then I set the xticks in the plot options and I can create the plot I want to.I am perfectly fine with my xticks to appear evenly spaced on the x-axis, like in my example below, and I guess this should be the standard behaviour for any categorical axis. Is this detour I was taking intended or is this an issue?