Get startedGet started for free

Evolution of the point guard

The agency is going to run an article on the evolution of the Point Guard position in basketball.

They have asked you to produce a line plot displaying points and assists for two players who have redefined the standards of this position - Steph Curry and Chris Paul. Two Bokeh source objects, steph and chris, have been preloaded for you along with a figure.

You will add line glyphs representing points and assists for the two players, using different glyph settings.

This exercise is part of the course

Interactive Data Visualization with Bokeh

View Course

Exercise instructions

  • Add line glyphs to represent Steph Curry's average points, filling in green, and setting the width to 2 and transparency to 0.5.
  • Display Steph Curry's average assists as line glyphs filled in purple, setting the width to 4 and transparency to 0.3.
  • For Chris Paul's average points, add line glyphs filled in red, setting the width to 1 and transparency to 0.8.
  • Add line glyphs to represent Chris Paul's average assists, filled in orange, with a width of 3 and transparency of 0.2.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

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)
Edit and Run Code