EDA of heritability
The array bd_parent_scandens
contains the average beak depth (in mm) of two parents of the species G. scandens
. The array bd_offspring_scandens
contains the average beak depth of the offspring of the respective parents. The arrays bd_parent_fortis
and bd_offspring_fortis
contain the same information about measurements from G. fortis birds.
Make a scatter plot of the average offspring beak depth (y-axis) versus average parental beak depth (x-axis) for both species. Use the alpha=0.5
keyword argument to help you see overlapping points.
This exercise is part of the course
Statistical Thinking in Python (Part 2)
Exercise instructions
- Generate scatter plots for both species. Display the data for G. fortis in blue and G. scandens in red.
- Set the axis labels, make a legend, and show the plot.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Make scatter plots
_ = ____(____, ____,
marker=____, linestyle=____, color=____, alpha=____)
_ = plt.plot(bd_parent_scandens, ____,
marker=____, linestyle=____, color=____, alpha=____)
# Label axes
_ = plt.____('parental beak depth (mm)')
_ = plt.____('offspring beak depth (mm)')
# Add legend
_ = plt.____(('G. fortis', 'G. scandens'), loc='lower right')
# Show plot
plt.show()