LoslegenKostenlos loslegen

Changing size

The estate agents have fed back that the subplots are quite large! They have asked you to make the next round of visualizations, displaying the relationship between the year a property was built with a) distance from the CBD and b) property size, a bit smaller.

You will manually specify the size of two subplots in row format.

Diese Übung ist Teil des Kurses

Interactive Data Visualization with Bokeh

Kurs anzeigen

Anleitung zur Übung

  • Set height to 300 pixels and width to 400 pixels for both distance_vs_year and building_size_vs_year.
  • Add circle glyphs to distance_vs_year, with x being the year_built and y representing distance from CBD.
  • Repeat for building_size_vs_year with the same x-axis, but setting y to building_area.
  • Finish the show() call to display the subplots in a row layout.

Interaktive Übung

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

# Set up figures
distance_vs_year = figure(x_axis_label="Year Built", y_axis_label="Distance from CBD (km)", height=____, width=____)
building_size_vs_year = figure(x_axis_label="Year Built", y_axis_label="Building Size (Meters Squared)", height=____, width=____)

# Add circle glyphs to distance_vs_year
distance_vs_year.circle(x="____", y="____", source=____)

# Add circle glyphs to building_size_vs_year
building_size_vs_year.circle(x="____", y="____", source=____)

# Generate HTML file and display plot
output_file(filename="custom_size_plot")
show(____(____, ____))
Code bearbeiten und ausführen