LoslegenKostenlos loslegen

Steals vs. assists

The agency has heard about linear color mapping and would like you to incorporate it into a plot visualizing steals versus assists. You will use linear color mapping to change the glyph color as assists increase.

A source object called source has been created from the nba dataset and preloaded for you.

Diese Übung ist Teil des Kurses

Interactive Data Visualization with Bokeh

Kurs anzeigen

Anleitung zur Übung

  • Import RdBu8 and linear_cmap from their respective classes.
  • Create mapper, adjusting color as the values of "assists" change using RdBu8.
  • Create a figure, with the title of "Steals vs. Assists".
  • Complete the call of circle glyphs to add the mapper.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Import required modules
____
____

# Create mapper
mapper = ____(field_name="____", palette=____, low=____, high=____)

# Create the figure
fig = figure(x_axis_label="Steals", y_axis_label="Assists", title="____")

# Add circle glyphs
fig.circle(x="steals", y="assists", source=source, color=____)
output_file(filename="steals_vs_assists.html")
show(fig)
Code bearbeiten und ausführen