import holoviews as hv; hv.extension('bokeh')
x,y = np.meshgrid(np.linspace(-1,1,101), np.linspace(-1,1,101))
z = np.sin(x+2*y)
hc = hv.operation.contours(hv.Image((x[0,:], y[:,0], z)), levels=[0, .1+1e-10,.4, .8]).opts(cmap=['#000000'], hover_line_color='red', tools=['hover'])
hp = hv.Path(([-.4,.2,.1],[-.4,.3,.4]),label='trajectory 1')*hv.Scatter(([-.4,.2,.1],[-.4,.3,.4]),label='trajectory 1')*\
hv.Path(([ .4,.2,.1],[-.4,.2,.3]),label='trajectory 2')*hv.Scatter(([ .4,.2,.1],[-.4,.2,.3]),label='trajectory 2')
hc*hp.opts(hv.opts.Contours(show_legend=False),hv.opts.Scatter(legend_position='right', width=700, height=400, muted_alpha=0),
hv.opts.Path(muted_alpha=0)
)
yields
-
opts.Contours
line color did not work for me,cmap
did… - I’d like to turn off the contour legends, and keep the trajectory legends. How?
- I’d also like to be able to control the numerical format of the contour levels
- the
muted_alpha = 0
opts allows muting the markers, but will not mute the Paths
Suggestions?