Answers for "box plot using matplotlib"

0

box plot python code

import pandas as pd 
import matplotlib.pyplot as plt 
% matplotlib inline
  
  
# load the dataset
df = pd.read_csv("tips.csv")
  
# display 5 rows of dataset
print(df.head())  

df.boxplot(by ='day', column =['total_bill'], grid = False)
Posted by: Guest on May-22-2021
2

python matplotlib boxplot

import numpy as np
import matplotlib.pyplot as plt

# Fixing random state for reproducibility
np.random.seed(19680801)

# fake up some data
spread = np.random.rand(50) * 100
center = np.ones(25) * 50
flier_high = np.random.rand(10) * 100 + 100
flier_low = np.random.rand(10) * -100
data = np.concatenate((spread, center, flier_high, flier_low))

fig1, ax1 = plt.subplots()
ax1.set_title('Basic Plot')
ax1.boxplot(data)
Posted by: Guest on July-13-2020

Code answers related to "box plot using matplotlib"

Python Answers by Framework

Browse Popular Code Answers by Language