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 :: purpose of meta class in django 
Python :: register admin django 
Python :: python select from list by condition 
Python :: pycharm update python version 
Python :: python socket get client ip 
Python :: module in python 
Python :: flask structure 
Python :: how to make tkinter look better 
Python :: df groupby 
Python :: add values to tuple python 
Python :: python stacked bar chart from dataframe 
Python :: format in python 
Python :: python add 1 to 100 
Python :: indexes meta django 
Python :: how to loop through pages of pdf using python 
Python :: Python List count() example 
Python :: python enumerate unique values 
Python :: turtle example 
Python :: with open 
Python :: Flatten List in Python Using NumPy Reshape 
Python :: how to join tables in python 
Python :: take absolute value in python 
Python :: python zip folder and subfolders 
Python :: django forms date picker 
Python :: python get line of exception 
Python :: best scraping package in python 
Python :: latest version of python 
Python :: how to make curl request python 
Python :: python convert b string to dict 
Python :: python sort 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =