LoslegenKostenlos loslegen

EDA of beak length and depth

The beak length data are stored as bl_1975 and bl_2012, again with units of millimeters (mm). You still have the beak depth data stored in bd_1975 and bd_2012. Make scatter plots of beak depth (y-axis) versus beak length (x-axis) for the 1975 and 2012 specimens.

Diese Übung ist Teil des Kurses

Statistical Thinking in Python (Part 2)

Kurs anzeigen

Anleitung zur Übung

  • Make a scatter plot of the 1975 data. Use the color='blue' keyword argument. Also use an alpha=0.5 keyword argument to have transparency in case data points overlap.
  • Do the same for the 2012 data, but use the color='red' keyword argument.
  • Add a legend and label the axes.
  • Show your plot.

Interaktive Übung

Versuche dich an dieser Übung, indem du diesen Beispielcode vervollständigst.

# 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
____
Code bearbeiten und ausführen