始める無料で始める

複数のプロット

最後の演習では、1ベッドルームと2ベッドルームのアパートの適正市場賃料を比較するプロットを作成します。

この演習はコースの一部です

Seaborn による中級データ可視化

コースを見る

演習の手順

  • ax0ax1 の2つの軸オブジェクトを作成します。
  • ax0fmr_1 を、ax1fmr_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()
コードを編集して実行