開始使用免費開始

喙長與喙深的 EDA

喙長資料分別存成 bl_1975bl_2012(單位為毫米 mm)。你也已經有喙深資料 bd_1975bd_2012。請為 1975 年與 2012 年的樣本,繪製以喙長為 x 軸、喙深為 y 軸的散佈圖。

本練習屬於課程

Statistical Thinking in Python(第 2 部分)

檢視課程

練習說明

  • 為 1975 年的資料繪製散佈圖。使用參數 color='blue'。同時加上 alpha=0.5 讓資料點重疊時具備透明度。
  • 對 2012 年的資料做相同的事,但使用參數 color='red'
  • 加上圖例,並標示座標軸。
  • 顯示你的圖表。

動手互動練習

試著完成這個範例程式碼,體驗一下這個練習。

# Make scatter plot of 1975 data
_ = ____(____, ____, marker='.',
             linestyle='None', ____, ____)

# Make scatter plot of 2012 data
_ = ____(____, ____, marker='.',
            linestyle='None', ____, ____)

# Label axes and make legend
_ = plt.____('beak length (mm)')
_ = plt.____('beak depth (mm)')
_ = plt.____(('1975', '2012'), loc='upper left')

# Show the plot
____
編輯並執行程式碼