Seaborn in Python

Logix_Quest
3 min readAug 25, 2020

--

Using Jupyter Notebook

Seaborn is a Python data visualization library based on matplotlib. It provides a high-level interface for drawing attractive and informative statistical. Seaborn works with the dataset as a whole and is much more intuitive than Matplotlib.

Seaborn

For Seaborn, replot() is the entry API with ‘kind’ parameter to specify the type of plot which could be line, bar, or many of the other types. Seaborn is not stateful. it can also be used to develop the attractiveness of matplotlib graphics. To see the use of Seaborn, let’s start.

Firstly you’ve to import libraries.

importing libraries

Now, we load dataset firstly. I’m loading dataset having .csv extension. To view it, we’ll call it by name.

loading dataset

Firstly, we’ll see the impact of regplot. The regplot() function takes an argument logistic , which allows you to specify whether you wish to estimate the logistic regression model for the given data using true or false values. This will also produce the plot of the fit.

regplot function

Now, let’s see catplot impact. The new catplot function provides a new framework giving access to several types of plots that show relationship between numerical variable and one or more categorical variables, like boxplot, stripplot and so on. Catplot can handle 8 different plots currently available in seaborn.

catplot function

Now, we see the use of distplot. The seaborn. distplot() function is used to plot the distplot. The distplot represents the univariate distribution of data i.e. data distribution of a variable against the density distribution.

distplot

You can change color of this graph.

changing color

You can assign name to axis as shown here.

naming axis

You can change its position as shown below.

changing position

You can remove (make invisible) its histogram.

invisible histogram

Now see the use of rug. A rug plot is a plot of data for a single quantitative variable, displayed as marks along an axis. It is used to visualize the distribution of the data. As such it is analogous to a histogram with zero-width bins, or a one-dimensional scatter plot.

rug plot

Here is an overview of Seaborn in python. If you like my work, don’t forget to clap.

Thank You.

--

--

Logix_Quest
Logix_Quest

No responses yet