20. WRITE A PROGRAM TO PLOT THIS DATA ON A BAR-STACKED HORIZONTAL HISTOGRAM WITH BOTH X AND Y.

MU = 100
SIGMA = 15
X = MU + SIGMA * NUMPY.RANDOM.RANDN(10000)
Y = MU + 30 * NUMPY.RANDOM.RANDN(10000)

Solution :-

import matplotlib.pyplot as plt
import numpy as np
mu=100
sigma=15
x=mu+sigma*np.random.randn(10000)
y=mu+30*np.random.randn(10000)
plt.hist([x,y],bins=100,histtype=’barstacked’)
plt.show()

Output :-