Get startedGet started for free

Facetting multiple regressions

lmplot() allows us to facet the data across multiple rows and columns. In the previous plot, the multiple lines were difficult to read in one plot. We can try creating multiple plots by Region to see if that is a more useful visualization.

This exercise is part of the course

Intermediate Data Visualization with Seaborn

View Course

Exercise instructions

  • Use lmplot() to look at the relationship between insurance_losses and premiums.
  • Create a plot for each Region of the country.
  • Display the plots across multiple rows.

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Create a regression plot with multiple rows
sns.lmplot(data=df,
           x="insurance_losses",
           y="premiums",
           ____="____")

# Show the plot
plt.show()
Edit and Run Code