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.
Questo esercizio fa parte del corso
Interactive Data Visualization with Bokeh
Istruzioni dell'esercizio
- Import
rowfrom the associated Bokeh module. - Add circle glyphs to both figures, representing
"price"on the y-axis versus"building_area"inbuilding_size, and"price"on the y-axis versus"distance"indistance. - 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.
Esercizio pratico interattivo
Prova a risolvere questo esercizio completando il codice di esempio.
# 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(____(____, ____))