Q. Prof Awasthi is doing some research in the field of Environment. For some plotting purposes, he has generated some data as :
mu = 100
sigma = 15
x = mu + sigma * numpy.random.randn(10000)
y = mu + 30 * np.random.randn (10000)
Write a program to plot this data on a cumulative bar-stacked horizontal histogram with both x and y.
Answer :-
import numpy as np
import matplotlib.pyplot as plt
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', cumulative = True)
plt.title('Research data Histogram')
plt.show()
Output:-
Post a Comment
You can help us by Clicking on ads. ^_^
Please do not send spam comment : )