I have 5 data sets from which I want to create 5 separate histograms. At the moment they are all going on one graph. How can I change this so that it produces two separate graphs?
For simplicity, in my example below I am showing just two histograms. I am looking at the distribution of angle a
at 3 different times and the same for angle b
.
n, bins, patches = plt.hist(a)
plt.xlabel('Angle a (degrees)')
plt.ylabel('Frequency')
n, bins, patches = plt.hist(b)
label='2pm,3pm,4pm'
loc = 'center'
plt.legend(label, loc)
plt.xlabel('Angle b(degrees)')
plt.title('Histogram of b')
plt.ylabel('Frequency')
label='2pm,3pm,4pm'
loc = 'center'
plt.legend(label, loc)
plt.show()
data.a.hist()
anddata.b.hist()
they all go into one single chart, while I want them to be in separate charts. So the accepted answer indeed helps here while this one unfortunately not :) – Baskin