Answers for "box plot"

0

how to plot box plot python

# Import libraries
import matplotlib.pyplot as plt
import numpy as np
 
 
# Creating dataset
np.random.seed(10)
data = np.random.normal(100, 20, 200)
 
fig = plt.figure(figsize =(10, 7))
 
# Creating plot
plt.boxplot(data)
 
# show plot
plt.show()
Posted by: Guest on January-02-2022
0

Box Plot, Python

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()
Posted by: Guest on January-26-2022

Python Answers by Framework

Browse Popular Code Answers by Language