Histogram

Snippet code to quickly implement histogram plots in Python

import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt

%matplotlib inline

Creating random data distributed normally

x_sample = np.random.normal(30, 5, 200)

Rendering the Plot

plt.figure(figsize=(9,6))
_ = plt.hist(x_sample, ec='black', bins=15)
plt.xlabel('X-Bins')
plt.ylabel('X-Counts')
plt.title('Histogram Example')
Box Plot