seaborn – plot amazing graphs

In this article we are going to see about seaborn an amazing graph plotting library .We will also see some basic examples of graph plotting using this library.

What is seaborn?

Seaborn is a library for making statistical graphics in Python. It is built on top of matplotlib and closely integrated with pandas data structures.

Here is some of the functionality that seaborn offers:

Installation

seaborn can be easily installed using pip as,

pip install seaborn

Example

import seaborn as snsfrom matplotlib import pyplot as pltfmri=sns.load_dataset('fmri')fmri.head()
sns.lineplot(x="timepoint",y="signal",data=fmri)plt.show()

Now, similarly, let’s go ahead and create a bar-plot:

sns.barplot(x="is_legendary",y="speed",data=pokemon)plt.show()

Now, let’s go ahead and create a scatter-plot on top of the iris dataset:

iris = pd.read_csv('iris.csv')iris.head()
sns.scatterplot(x="Sepal.Length",y="Petal.length",data=iris)plt.show()

Hope this article gave you some basic idea about the seaborn library. For additional methods and complex tutorial refer their official documentation here.

Happy coding!