면적, 위치, 그리고 가격
이제 부동산 중개인은 가격이 주택의 면적 및 중심업무지구(CBD)까지의 거리와 어떻게 관련되는지 파악하고자 해요.
이 경우 두 도형의 y축 단위가 동일하므로, 서브플롯을 가로로 나란히 배치하는 것이 적절해요. source는 melb 데이터셋을 사용해 Bokeh 객체로 준비되어 있으며, 미리 로드되어 있어요.
이 연습은 강의의 일부입니다
Bokeh로 배우는 인터랙티브 데이터 시각화
연습 안내
- 관련 Bokeh 모듈에서
row를 가져오세요. - 두 도형 모두에 원형 글리프를 추가하세요.
building_size에서는 y축"price"대 x축"building_area",distance에서는 y축"price"대 x축"distance"를 나타내요. - 두 도형의 y축 표시 형식을 백만 달러 단위인
$0a로 업데이트하세요. - 두 서브플롯이 모두 표시되도록
show()호출을 완성하세요.
실습형 인터랙티브 연습
이 예제를 이 샘플 코드를 완성하여 풀어보세요.
# 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(____(____, ____))