複数のプロット
最後の演習では、1ベッドルームと2ベッドルームのアパートの適正市場賃料を比較するプロットを作成します。
この演習はコースの一部です
Seaborn による中級データ可視化
演習の手順
ax0とax1の2つの軸オブジェクトを作成します。ax0にfmr_1を、ax1にfmr_2をプロットします。- 2つのプロットを横並びに表示します。
実践的なインタラクティブ演習
このサンプルコードを完成させて、この演習に挑戦してみましょう。
# Create a plot with 1 row and 2 columns that share the y axis label
fig, (ax0, ax1) = plt.subplots(nrows=____, ncols=____, sharey=____)
# Plot the distribution of 1 bedroom apartments on ax0
sns.histplot(df['____'], ax=____)
____.set(xlabel="1 Bedroom Fair Market Rent", xlim=(100,1500))
# Plot the distribution of 2 bedroom apartments on ax1
sns.histplot(df['____'], ax=____)
____.set(xlabel="2 Bedroom Fair Market Rent", xlim=(100,1500))
# Display the plot
plt.show()