Relplots
Learn to use Seaborn's relplot function to visualize relationships between numerical variables with scatter and line plots. Discover how to customize plots with hues, facets, and layout settings to better analyze and interpret your data.
We'll cover the following...
Overview
Relplot stands for the relational plot that allows us to study the relationships between different variables. We can access both scatter plots and line plots within the relational plot. It’s built on top of seaborn’s FacetGrid, allowing us to access FacetGrid functionality within the relplot.
Accessing scatter plot within relplot
We’ve imported the titanic dataset from the seaborn library and viewed the first five records using the pandas head() method.
Let’s draw a relplot using the sns.relplot() function and specify x='age', y='fare', and hue ='class'. The resulting plot is a scatter plot for the age and fare variables. Relplot shows a scatter plot by default.
Any parameter that we use with a scatter plot can also be used in a ...