xxxxxxxxxx
import seaborn as sns
sns.boxenplot(data=df, y="cat_col", x="num_col")
xxxxxxxxxx
import seaborn
seaborn.set(style='whitegrid')
tip = seaborn.load_dataset('tips')
seaborn.boxplot(x='day', y='tip', data=tip)
xxxxxxxxxx
>>> import seaborn as sns
>>> sns.set_theme(style="whitegrid")
>>> ax = sns.boxplot(x=tips["total_bill"])
xxxxxxxxxx
import matplotlib.pyplot as plt
import seaborn as sns
sns.catplot(x="cat_col", y="num_col",
order=["cat A", "cat B"], # Specify order of categories
data=df, sym="", # Omit outliers
kind="box", whis = 0.5) # Set the whiskers to 0.5 * IQR or [5,95] for 5th to 95th percentile
# Show plot
plt.show()
xxxxxxxxxx
import seaborn as sns
# Load example dataset
tips = sns.load_dataset("tips")
# Create a box plot using Seaborn
sns.boxplot(x="day", y="total_bill", data=tips)
# Show the plot
sns.plt.show()
xxxxxxxxxx
import seaborn as sns
import matplotlib.pyplot as plt
%matplotlib inline
sns.boxplot(x="day", y="total_bill", data=tips,palette='rainbow') # box plot
sns.boxplot(x="day", y="total_bill", data=tips,palette='rainbow', orient='h') \
# box plot in horizontal mode
sns.boxplot(x="day", y="total_bill", hue="smoker",data=tips, palette="coolwarm") \
# box plot with simultabeous boxes for smoker categories
plt.show()