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 :: python includes string 
Python :: while loop py 
Python :: django charfield force lowercase 
Python :: python sort list by custom function 
Python :: how to delete item from list python 
Python :: dict comprehension 
Python :: gridsearch cv 
Python :: pandas write image to excel 
Python :: time.sleep() python 
Python :: loginrequiredmixin django 
Python :: python threading return value 
Python :: pyhton map 
Python :: numpy array divide each row by its sum 
Python :: invert binary tree with python 
Python :: tkinter filedialog how to show more than one filetype 
Python :: python requests post form data 
Python :: series astype 
Python :: python turtle module 
Python :: bar plot python 
Python :: how to create barcode in python 
Python :: upload file to aws 
Python :: get value from index python 
Python :: 231a codeforces solution in python 
Python :: read api from django 
Python :: python min value index from an array 
Python :: super in django manager 
Python :: marshmallow default value 
Python :: python curl 
Python :: scikit learn to identify highly correlated features 
Python :: how can I corect word spelling by use of nltk? 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =