Stripplot

It basically creates a scatter plot based on the category.

Syntax: 

stripplot([x, y, hue, data, order, …])

Example:  

Python3




sns.stripplot(x ='day', y ='total_bill', data = df,
              jitter = True, hue ='smoker', dodge = True)


Output: 

Explanation/Analysis –  

  • One problem with strip plot is that you can’t really tell which points are stacked on top of each other and hence we use the jitter parameter to add some random noise.
  • jitter parameter is used to add an amount of jitter (only along the categorical axis) which can be useful when you have many points and they overlap, so that it is easier to see the distribution.
  • hue is used to provide an addition categorical separation
  • setting split=True is used to draw separate strip plots based on the category specified by the hue parameter.

Seaborn | Categorical Plots

Plots are basically used for visualizing the relationship between variables. Those variables can be either be completely numerical or a category like a group, class or division. This article deals with categorical variables and how they can be visualized using the Seaborn library provided by Python. 

Seaborn besides being a statistical plotting library also provides some default datasets. We will be using one such default dataset called ‘tips’. The ‘tips’ dataset contains information about people who probably had food at a restaurant and whether or not they left a tip for the waiters, their gender, whether they smoke and so on.
Let us have a look at the tips dataset.

Code 

Python3




# import the seaborn library
import seaborn as sns
 
# import done to avoid warnings
from warnings import filterwarnings
 
# reading the dataset
df = sns.load_dataset('tips')
 
# first five entries if the dataset
df.head()



Now lets proceed onto the plots so that we can how we can visualize these categorical variables.

Similar Reads

Barplot

...

Countplot

A barplot is basically used to aggregate the categorical data according to some methods and by default its the mean. It can also be understood as a visualization of the group by action. To use this plot we choose a categorical column for the x axis and a numerical column for the y axis and we see that it creates a plot taking a mean per categorical column....

Boxplot

...

Violinplot

A countplot basically counts the categories and returns a count of their occurrences. It is one of the most simple plots provided by the seaborn library....

Stripplot

...

Swarmplot

A boxplot is sometimes known as the box and whisker plot.It shows the distribution of the quantitative data that represents the comparisons between variables. boxplot shows the quartiles of the dataset while the whiskers extend to show the rest of the distribution i.e. the dots indicating the presence of outliers....

Factorplot

...