What is relational plot and how to Make a relational plot using seaborn?

This recipe explains what is relational plot and how to Make a relational plot using seaborn

Recipe Objective

what is relational plot? Make a relational plot using seaborn.

Relational Plot the statistical relationship between the data points is visualized with the help of these plot, the function for this plot is relplot() which provides us access to some other different axes-level functions which shows the relationships between two variables with semantic mappings of subsets.

The scatterplot and lineplot both plots can be drawn by using kind parameter in the relplot. By default the relplot gives us scatterplot, lineplot can be drawn by using kind.

Step 1 - Import the necessary libraries

import seaborn as sns

Step 2 - load the dataset

Sample_data = sns.load_dataset('penguins') Sample_data.head()

Step 3 - Plot the graph

sns.relplot(x="flipper_length_mm", y="body_mass_g", data=Sample_data)

Step 4 - Plot the line graph

sns.relplot(x="flipper_length_mm", y="body_mass_g", data=Sample_data, kind="line")

Here from the above figures: x - denotes which variable to be plot on x-axis y - denotes which variable to be plot on y-axis data - denotes the Sample data name that we have taken. kind - denotes which type of graph we want for plotting for e.g bar, scatter, line etc.

What Users are saying..

profile image

Savvy Sahai

Data Science Intern, Capgemini
linkedin profile url

As a student looking to break into the field of data engineering and data science, one can get really confused as to which path to take. Very few ways to do it are Google, YouTube, etc. I was one of... Read More

Relevant Projects

PyTorch Project to Build a GAN Model on MNIST Dataset
In this deep learning project, you will learn how to build a GAN Model on MNIST Dataset for generating new images of handwritten digits.

Time Series Forecasting with LSTM Neural Network Python
Deep Learning Project- Learn to apply deep learning paradigm to forecast univariate time series data.

Learn to Build an End-to-End Machine Learning Pipeline - Part 1
In this Machine Learning Project, you will learn how to build an end-to-end machine learning pipeline for predicting truck delays, addressing a major challenge in the logistics industry.

House Price Prediction Project using Machine Learning in Python
Use the Zillow Zestimate Dataset to build a machine learning model for house price prediction.

Model Deployment on GCP using Streamlit for Resume Parsing
Perform model deployment on GCP for resume parsing model using Streamlit App.

Build Real Estate Price Prediction Model with NLP and FastAPI
In this Real Estate Price Prediction Project, you will learn to build a real estate price prediction machine learning model and deploy it on Heroku using FastAPI Framework.

Build a Customer Churn Prediction Model using Decision Trees
Develop a customer churn prediction model using decision tree machine learning algorithms and data science on streaming service data.

OpenCV Project for Beginners to Learn Computer Vision Basics
In this OpenCV project, you will learn computer vision basics and the fundamentals of OpenCV library using Python.

Loan Default Prediction Project using Explainable AI ML Models
Loan Default Prediction Project that employs sophisticated machine learning models, such as XGBoost and Random Forest and delves deep into the realm of Explainable AI, ensuring every prediction is transparent and understandable.

Build a Logistic Regression Model in Python from Scratch
Regression project to implement logistic regression in python from scratch on streaming app data.