我有一个Bokeh图像图,我想以交互方式更改,例如:
color_mapper = LinearColorMapper(palette="Viridis256", low=tmp.min(), high=tmp.max())
p = figure(plot_width=tmp.shape[0], plot_height=tmp.shape[1],
x_range=(0, tmp.shape[0]), y_range=(0, tmp.shape[1]))
img = p.image(image=[tmp], x=[0], y=[0], dw=[tmp.shape[0]],
dh=[tmp.shape[1]], color_mapper=color_mapper)
我可以使用以下方法更新彩色地图中的范围:
^{pr2}$但是,我希望能够交互式地更改为不同类型的颜色映射,例如从LinearColorMapper
到{LinearColorMapper
对象,而不是替换它。有没有一种方法可以在不需要再次调用image
的情况下以交互方式执行此操作?在
找到它,它在
image
实例的glyph
对象中。你可以用另一个ColorMapper
来代替它,例如:相关问题 更多 >
编程相关推荐