Seaborn Relational Plots - Introduction



The statistical link between the data points is visualized using relational graphs. Because visualization helps humans to detect trends and patterns in data, it is vital. Statistical analysis is the process of determining how the variables in a dataset relate to one another and their relationships.

Relational plots like the name suggests shows how two variables of a dataset are associated with each other.

Seaborn provides a few methods to make plotting relational plots easier. In the coming articles we will look at all the functions that will enable relational plotting.

Functions

The list of all the Seaborn relational functions is given below.

S.No Method and Description
1 relplot()

This method allows the user to plot association between variables and mapping between different semantic groups.

2 lineplot()

This method allows the user to draw a line plot with possibility of several semantic groupings.

3 scatterplot()

This method allows the user to draw a scatter plot with possibility of several semantic groupings.

Before moving on, we require data to plot graphs and in case, data is not available readily for your use, you can use the datasets present in the seaborn library.

Seaborn contains various default datasets in addition to being a statistical charting toolkit. We'll use the one of the in-built datasets as an example of a default dataset.

Let us consider the tips dataset in the first example. The 'tips' dataset comprises information about people who have likely eaten at a restaurant and whether or not they left a tip for the servers, as well as their gender, smoking status, and other factors.

The get_dataset_names() method helps to retrieve all the names of the in-built datasets.

seaborn.get_dataset_names()

The load_dataset() method helps to load the dataset with the name into a data structure.

Tips=seaborn.load_dataset('tips')

The above line of code helps to load the dataset with the name 'tips' into a data structure called tips.

Now that we have data to plot, let us understand how to plot relational graphs using Seaborn library.

seaborn_function_reference.htm
Advertisements