![](/img/trans.png)
[英]Python: Altair: Conditionally change axis label appearance (color, opacity)
[英]Altair change color of label in binding_radio
我想在 binding_radio 选择器中更改“此标签”的颜色:这可能吗?
我找不到任何关于它的...
任何帮助将不胜感激!
df = pd.DataFrame({'x':[0,0],'y':[10,20],'color':['red','blue']})
groups = df['y'].tolist()
radio_groups = alt.binding_radio(
options = groups,
name = 'This label'
)
select_group = alt.selection(
type = 'single',
fields = ['y'],
bind = radio_groups,
empty ='none',
init = {'y': 10}
)
alt.Chart(
df
).mark_bar(
).encode(
x = 'x:O',
y='y:O',
color = 'y:O'
).add_selection(
select_group
).transform_filter(
select_group
)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.