
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
How Seaborn library used to display a kernel density estimation plot (joinplot) in Python?
Seaborn is a library that helps in visualizing data. It comes with customized themes and a high level interface.
Kernel Density Estimation, also known as KDE is a method in which the probability density function of a continuous random variable can be estimated. This method is used for the analysis of the non-parametric values. While using ‘jointplot’, if the argument ‘kind’ is set to ‘kde’, it plots the kernel density estimation plot.
Let us understand how the ‘jointplot’ function works to plot a kernel density estimation in python.
Example
import pandas as pd import seaborn as sb from matplotlib import pyplot as plt my_df = sb.load_dataset('iris') sb.jointplot(x = 'petal_length',y = 'petal_width',data = my_df,kind = 'kde') plt.show()
Output
Explanation
The required packages are imported.
The input data is ‘iris_data’ which is loaded from the scikit learn library.
This data is stored in a dataframe.
The ‘load_dataset’ function is used to load the iris data.
This data is visualized using the ‘jointplot’ function.
Here, the ‘x’ and ‘y’ axis values are supplied as parameters.
Here, the ‘kind’ parameter is specified as ‘kde’ so that the plot understands to print kernel density estimation.
This kernel density estimation data is displayed on the console.
- Related Articles
- How can Seaborn library be used to display kernel density estimations in Python?
- How can Seaborn library be used to display a hexbin plot in Python?
- How can Seaborn library be used to display a Scatter Plot in Python?
- How can bar plot be used in Seaborn library in Python?
- How can Seaborn library be used to display categorical scatter plots in Python?
- How to plot a kernel density plot of dates in Pandas using Matplotlib?
- How can seaborn library be used to display data without the background axis spines in Python?
- How can Seaborn library be used to visualize point plots in Python?
- How can FacetGrid be used to visualize data in Python Seaborn Library?
- How can every violin in a violin plot be split in Python Seaborn Library?
- How can the countplot be used to visualize data in Python Seaborn Library?
- How to plot a density map in Python Matplotlib?
- How to save a plot in Seaborn with Python (Matplotlib)?
- How to avoid the points getting overlapped while using stripplot in categorical scatter plot Seaborn Library in Python?
- How can Bokeh library be used to plot horizontal bar plots using Python?
