Plot two histograms at the same time with Matplotlib
Plot multiple histograms
import numpy as np import matplotlib.pyplot as plt age = np.random.normal(loc=1, size=100) # a normal distribution salaray = np.random.normal(loc=-1, size=10000) # a normal distribution _, bins, _ = plt.hist(age, bins=50, range=[-6, 6], density=True) _ = plt.hist(salaray, bins=bins, alpha=0.5, density=True) plt.show()
The following is the output that will be obtained:
2018-11-16T07:32:22+05:30
2018-11-16T07:32:22+05:30
Amit Arora
Amit Arora
Python Programming Tutorial
Python
Practical Solution