LoslegenKostenlos loslegen

Size, location, and price

Next, the estate agents would like to understand how price is related to the size of the property and its distance from the Central Business District (CBD).

In this case, the y-axis of both figures will have the same units, so making a row of subplots is an appropriate choice. source has been set up as a Bokeh object using the melb dataset, and preloaded for you.

Diese Übung ist Teil des Kurses

Interactive Data Visualization with Bokeh

Kurs anzeigen

Anleitung zur Übung

  • Import row from the associated Bokeh module.
  • Add circle glyphs to both figures, representing "price" on the y-axis versus "building_area" in building_size, and "price" on the y-axis versus "distance" in distance.
  • Update the y-axis of both figures to display in the format of $0a, for millions of dollars.
  • Complete the call of show() to display both subplots.

Interaktive Übung

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

# Import row
from ____.____ import ____
building_size = figure(x_axis_label="Building Area (Meters Squared)", y_axis_label="Sales")
distance = figure(x_axis_label="Distance from CBD (km)", y_axis_label="Sales")

# Add circle glyphs
building_size.circle(x="____", y="____", source=____)
distance.circle(x="____", y="____", source=____)

# Update the y-axis format for both figures
building_size.____[____].____ = ____(____="____")
distance.____[____].____ = ____(____="____")

# Display the subplots
output_file(filename="my_first_row.html")
show(____(____, ____))
Code bearbeiten und ausführen