Plotting subgroups in line plots
Let's continue to look at the mpg
dataset. We've seen that the average miles per gallon for cars has increased over time, but how has the average horsepower for cars changed over time? And does this trend differ by country of origin?
This exercise is part of the course
Introduction to Data Visualization with Seaborn
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Import Matplotlib and Seaborn
import matplotlib.pyplot as plt
import seaborn as sns
# Create line plot of model year vs. horsepower
# Show plot
plt.show()