绘图..当xaxis具有字符串类别时,圆圈不工作

2024-06-23 19:51:06 发布

您现在位置:Python中文网/ 问答频道 /正文

我的数据在x轴上有“string”数据类型的分类变量。可以用bokeh在我的线图点上画圆吗


Tags: 数据stringbokeh分类数据类型线图画圆
1条回答
网友
1楼 · 发布于 2024-06-23 19:51:06

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)

相关问题 更多 >

    热门问题