我的工作,試圖從這個http://fortune.com/fortune500/visualizations/?iid=recirc_f500landing-zone1如何添加懸停高亮背景虛化步驟圖表
複製類似於第二圖形代碼中有散景默認步驟圖表,但並不想讓我添加字形。
我想代碼是這樣的
from bokeh.charts import Step, show, output_file
# build a dataset where multiple columns measure the same thing
data = dict(
stamp=[.33, .33, .34, .37, .37, .37, .37, .39, .41, .42,
.44, .44, .44, .45, .46, .49, .49],
postcard=[.20, .20, .21, .23, .23, .23, .23, .24, .26, .27,
.28, .28, .29, .32, .33, .34, .35]
)
# create a step chart where each column of measures receives a unique color and dash style
step = Step(data, y=['stamp', 'postcard'],
dash=['stamp', 'postcard'],
color=['stamp', 'postcard'],
title="U.S. Postage Rates (1999-2015)",
ylabel='Rate per ounce', legend=True)
selected_line = Line(line_alpha=1, line_color="firebrick")
nonselected_line = Line(line_alpha=0.2, line_color="blue")
step.add_glyph(data,
step,
selection_glyph=selected_line,
nonselection_glyph=nonselected_line
)
output_file("steps.html")
show(step)
我試圖從http://bokeh.pydata.org/en/latest/docs/user_guide/styling.html#selected-and-unselected-glyphs此頁每路有建立這個情節沒有圖表庫的方法嗎?