Seaborn is an open-source Python library built on top of matplotlib. It is used for data visualization and exploratory data analysis. Seaborn is commonly used for data science and machine learning task.
How to install Seaborn?
We can install Seaborn using following command, python and pip installation on the machine is pre required.
pip install seaborn
Importing Matplotlib
To Import the pyplot object of the Matplotlib module in our code use the following command.
import matplotlib.pyplot as plt
Importing Seaborn
To import the seaborn in our code use the following command.
import seaborn as sns
Distplots
Distplot stands for distribution plot, it takes as input an array and plots a curve corresponding to the distribution of points in the array. Following example shows the plotting of Distplot-
import matplotlib.pyplot as plt
import seaborn as sns
sns.distplot([0, 1, 2, 3, 4, 5])
plt.show()
Output-
To show plot without histogram we can use sns.distplot(arr, hist=False).
Leave a Reply