当x轴有字符串类别时,plot...圆圈不能使用

问题描述 投票:0回答:1

我的数据在x轴上有 "字符串 "d类型的分类变量。可以在我的线型图点上绘制具有虚化效果的圆圈吗?

python plot bokeh
1个回答
0
投票

可以。

from bokeh.io import show
from bokeh.models import ColumnDataSource
from bokeh.plotting import figure

p = figure(x_range=['a', 'b', 'c'])
ds = ColumnDataSource(dict(x=list('aaabbbccc'), y=list(range(9))))
p.line('x', 'y', source=ds)
p.circle('x', 'y', source=ds, color='red', size=20)

show(p)
© www.soinside.com 2019 - 2024. All rights reserved.