So I have created a radial HeatMap with Holoviews & Bokeh, but for the moment it uses a single cmap (left) and I would like to apply different cmap (right, modified with Gimp). Is there a way to do so ?
(Radial HeatMap based on https://holoviews.org/reference/elements/bokeh/RadialHeatMap.html)
Thanks !
EDIT :
Initial code:
def hook(p, _):
p.state.xgrid.grid_line_color = None
p.state.ygrid.grid_line_color = None
p.state.axis.visible = False
p.state.outline_line_color = None
heatmap = hv.HeatMap(df, ["Criterion", "Factor"])
heatmap.opts(opts.HeatMap(radial=True, width=800, height=800, cmap='cwr', tools=["hover"], hooks=[hook], xmarks=[sum([len(d.criteria) for d in data[:i]]) for i in range(len(data))], ymarks=0, xticks=None, yticks=None))
Modified code to generate partial heatmaps :
def hook(p, _):
p.state.xgrid.grid_line_color = None
p.state.ygrid.grid_line_color = None
p.state.axis.visible = False
p.state.outline_line_color = None
all_heatmaps = None
for d in data:
sub_df = df.copy()
sub_df.loc[~df['Criterion'].isin(d.criteria), 'Value'] = np.nan
heatmap = hv.HeatMap(sub_df, ["Criterion", "Factor"])
heatmap.opts(opts.HeatMap(radial=True, width=800, height=800, cmap=d.cmap, tools=["hover"], hooks=[hook], xmarks=[sum([len(d.criteria) for d in data[:i]]) for i in range(len(data))], ymarks=0, xticks=None, yticks=None))
all_heatmaps = all_heatmaps * heatmap if all_heatmaps else heatmap
Result :
We only see the outlines of the heatmaps underneath the last one.