DynamicMap influences line colors

Hi,
I found a strange behaviour when I wrap a method in a DynamicMap:
Screen Recording 2021-11-28 at 02.10.56

As you can see line colors are different (and some labels too) whether the method is called inside a DynamicMap or not. Does anybody know what I can do about it? I need the DynamicMap because I need to align different methods from a class using Layout.

Cheers,
Roberto

As a workaround I keep that particular method outside the Layout so that I don’t wrap it in a DynamicMap. I build the final visualization with pn.Column(LFP_viewer_.lfp_view, hv.Layout(sel_plots).cols(1)). Everything is still properly aligned and the label and colors are correctly assigned.

Solved this: you can assign color to Curves with a dictionary like this:

.opts.Curve(color=dim("area").categorize(palette)) (palette is a dictionary{“area_name”:“color”})

3 Likes