开始使用免费开始使用

控球后卫的演变

该机构将发布一篇关于篮球中控球后卫(Point Guard)位置演变的文章。

他们请您制作一幅折线图,展示两位重新定义该位置标准的球员——Steph Curry 和 Chris Paul——的得分与助攻。两个 Bokeh 数据源对象 stephchris 以及一个图形对象已为您预加载。

您将为两位球员的得分与助攻分别添加折线图元,并使用不同的图元设置。

本练习是课程的一部分

使用 Bokeh 进行交互式数据可视化

查看课程

练习说明

  • 为 Steph Curry 的场均得分添加线型图元,填充为绿色,设置宽度为 2,透明度为 0.5
  • 将 Steph Curry 的场均助攻显示为线型图元,填充为紫色,设置宽度为 4,透明度为 0.3
  • 对于 Chris Paul 的场均得分,添加线型图元,填充为红色,设置宽度为 1,透明度为 0.8
  • 为 Chris Paul 的场均助攻添加线型图元,填充为橙色,宽度设为 3,透明度为 0.2

交互式实操练习

通过完成这段示例代码来试试这个练习。

fig = figure(x_axis_label="Season", y_axis_label="Performance")

# Add line glyphs for Steph Curry
fig.line(x="season", y="points", source=steph, ____=____, ____="____", ____=____, legend_label="Steph Curry Points")
fig.line(x="season", y="assists", source=steph, ____=____, ____="____", ____=____, legend_label="Steph Curry Assists")

# Add line glyphs for Chris Paul
fig.line(x="season", y="points", source=chris, ____=____, ____="____", ____=____, legend_label="Chris Paul Points")
fig.line(x="season", y="assists", source=chris, ____=____, ____="____", ____=____, legend_label="Chris Paul Assists")

output_file(filename="point_guards.html")
show(fig)
编辑并运行代码