Hello!
I have an interactive plot driven through panel
and using df.hvplot.scatter(...)
. When I make an update in the widgets that control axes, the data (x,y, and c) all update fine and the xlabel and ylabel udpate as well, but but the clabel (on the colorbar) stays at the initial value. You can see this on the attached gif.
Here’s the code:
def plot_pareto(pareto_sum, x,y,z, thresh, generations):
if thresh is not None:
pareto_sum = pareto_sum.loc[(pareto_sum.total_ng_commit_pumping>=thresh[0]) &
(pareto_sum.total_ng_commit_pumping<=thresh[1])]
if generations is not None:
pareto_sum = pareto_sum.loc[(pareto_sum.index>=generations[0]) &
(pareto_sum.index<=generations[1])]
pplot = pareto_sum.hvplot.scatter(x=objectives_r[x],
y=objectives_r[y],
c=objectives_r[z],
legend=False,
hover_cols=list(objectives.keys()))
hover_run = HoverTool(
tooltips = list(zip(
[f'{k}:' for k in objectives_r.keys()],
[f'@{v}{{%3.2f}}%' for v in objectives_r.values()])),
formatters = {f'@{v}': 'printf' for v in objectives_r.values()}
)
pplot.opts(
xlabel=x,
ylabel=y,
clabel=z,
size=10,
height=300,
width=650,
title=z,
tools=['tap', hover_run],
active_tools=['pan','tap','wheel_zoom'],
cmap='magma'
)
return pplot