Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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()
Comment

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()
Comment

PREVIOUS NEXT
Code Example
Python :: django bulk update 
Python :: using Decorators 
Python :: django redirect 
Python :: read csv python 
Python :: python class arbitrary arguments 
Python :: Your WhiteNoise configuration is incompatible with WhiteNoise v4.0 
Python :: Set value of dataframe using condition 
Python :: The datetime and django.utils.timezone modules are available, so you can do e.g. timezone.now 
Python :: python get first occurrence in list 
Python :: python create random mac 
Python :: python default keyword parameter list 
Python :: matrix diagonal sum leetcode in java 
Python :: how to make a window python 
Python :: python tuple and dictionary 
Python :: add icon to exe file 
Python :: pandas remove whitespace 
Python :: python how to extract a string from another string 
Python :: uppercase python 
Python :: #remove a sublist from a list-use remove method 
Python :: python -c 
Python :: get mode using python 
Python :: numpy evenly spaced numbers 
Python :: get column or row of matrix array numpy python 
Python :: python insert sorted 
Python :: enumerate in django templte 
Python :: stack more system in python 
Python :: python qr decomposition 
Python :: len of iterator python 
Python :: python print values inside request.POST 
Python :: python string: .join() 
ADD CONTENT
Topic
Content
Source link
Name
9+1 =