Visualization with Strip Plots
Learn how to plot, design, and interpret strip plots to obtain data insights.
We'll cover the following...
Overview
A strip plot is a categorical scatter plot, where one variable is numeric, and the other is categorical. It’s similar to a swarm plot; we represent data values as circular dots on both swarm and strip plots. The primary distinction is that the data points in a swarm plot do not overlap. On the other hand, the points in a strip plot may overlap.
Plotting a strip plot
In this lesson, we’ll use the “penguins” dataset. It has been loaded into the DataFrame penguins_df
after removing the null values. Let’s begin our visualizations. We pass x='sex'
and y='body_mass_g'
in the sns.stripplot()
function to see the variation in body mass between male and female penguins.
sns.stripplot(data = penguins_df,x='sex', y='body_mass_g') # categorize on genderplt.savefig('output/graph.png')
We can observe from the plot above that most male penguins have a higher body_mass_g
...