I am trying to create a boxplot with jitter using the boxplot
and stripplot
in seaborn
. Unfortunately my data has some outliers so I decide to exclude them in the final plot.
For the boxplot, it's easy to use showfliers=False
argument to ignore the outliers. However stripplot does not have the similar argument. Since my dataset has outliers with extreme values, the y-axis is over-stretched, making it difficult to see the boxes.
Sample code:
import seaborn as sns
tips = sns.load_dataset("tips")
fig, ax = plt.subplots()
ax = sns.boxplot(x="day", y="total_bill", data=tips, showfliers=False)
ax = sns.stripplot(x="day", y="total_bill", data=tips)
fig.show()
Would it be easier just to filter out the outliers in the original dataframe before plotting?