Boxplot,Histogram codes with explanations
Boxplot,Histogram codes with explanations
values = [2, 3, 4, 1, -3.04, 5, 4, 6, 7, 2, 4, 6, 8, 6 , 9, 12, 14, 11, 5, 16] # Data points (unordered)
plt.boxplot(values, whis="range", vert=False) # Boxplot considering all data points within range
import numpy as np
Histogram Notebook
import matplotlib.pyplot as plt
import numpy as np
import numpy as np
x = [21,22,23,4,5,6,77,8,9,10,31,32,33,34,35,36,37,18,49,50,100]
bin_heights, bins, patches = plt.hist(x, bins=10, facecolor='cyan') # Plot histogram with cyan color