Open nr7s opened 6 years ago
@philippjfr @jbednar Any thoughts on this?
We really do need to get some proper legend and colorbar support for datashader plots; it's way overdue (like so many other things...). But I think you're on the right track here; the fake points that are overlaid need to be valid points for this plot. Maybe just debug it by trying to overlay a single Point somewhere clearly visible; once that works the NdOverlay of points should be a tiny step from there.
I got this to work with the following code:
hvObj *= hv.NdOverlay({k: hv.Scatter(data_df.head(1), kdims='time', vdims=y, label=str(k)).opts(
style=dict(color=cmap[i])) for i, k in enumerate(signal_names)})
1) Used Scatter
in place of Points
2) Selected the first row of my dataset to provide an existing point
This is based on my data structure where
hvObj
contains several overlayed datashader objectsdata_df
is a pandas dataframe containing the raw data and a column containing pd.date_range
cmap
is a list of colourssignal_names
is a list of strings (legends)
Is there a way to overlay a legend plot like the ones from this User Guide - Multidimensional plots section. What happens right now is that when you overlay the legend on the timeseries plot you lose the automatic handling of the datetime x axis
I thought it was because the points being used for the column were 0,0 and maybe passing them as the first point of the curve I'm trying to plot would work but I get the following error:
I used something like this