散景Taptool选择颜色 [英] bokeh taptool selection colours

查看:48
本文介绍了散景Taptool选择颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在bokeh中使用 TapTool 来选择我在 gmap 顶部绘制的一些圆圈.当前,选定的圆圈在前景中,其余的淡入地图背景.

是否可以更改此默认行为?例如,我想给选定的圆赋予不同的颜色边界,并使其余颜色保持不变.有没有一种方法可以更改选定对象和未选定对象的渲染?

解决方案

I am using the TapTool in bokeh to select some circles which I have drawn on top of a gmap. Currently, the selected circle is in the foreground and the rest fade into the map background.

Is there a way to change this default behaviour? I would like, for example, to give a different colour boundary to the selected circle and keep the rest the same. Is there a way to change the rendering of the selected and unselected objects?

解决方案

The Styling Visual Attributes chapter of the User's Guide has a section specifically for Selected and Unselected Glyphs. The easiest way is to use the convenience paramters that can be passed to the glyph methods:

plot.circle([1, 2, 3, 4, 5], [2, 5, 8, 2, 7], size=50,

            # set visual properties for selected glyphs
            selection_color="firebrick",

            # set visual properties for non-selected glyphs
            nonselection_fill_alpha=0.2,
            nonselection_fill_color="blue",
            nonselection_line_color="firebrick",
            nonselection_line_alpha=1.0)

这篇关于散景Taptool选择颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆