I have two arrays:
For example:
a=[1, 2, 3, 4]
b=[10, 20, 30, 40]
And from those number I need to plot histogram, I known that is easy to plot curve with coordinates likes this (1,10), (2, 20) and etc. But how to plot histogram from arrays. Currently I am stuck with option to draw histogram. Any suggestion would be good.
import matplotlib.pyplot as plt
import numpy as np
a = [([97, 99, 99, 96, 97, 98, 99, 97, 99, 99, 96, 97, 99, 99, 95,
98, 99, 97, 97, 98, 97, 96, 98, 98, 98, 98, 98, 98, 96, 98, 98, 98, 98,
98, 98, 96, 97, 97, 97, 97, 97, 96, 96, 97, 97, 96, 95, 97, 96, 97, 96, 97,
96, 95, 96, 97, 95, 95, 93, 93, 92, 93, 93, 95, 95, 94, 93, 94, 94, 95, 95, 95,
95, 96, 96, 95, 96, 96, 96, 96, 94, 95, 90, 95, 95, 95, 95,
95, 88, 94, 94, 93, 95, 95, 94, 95, 95, 95, 95, 95, 93],)]
for item in a[0]:
s = item
lengths = len(s)
s2 = [s[x:x+9] for x in xrange(0, len(s), 9)]
print s2.index(min(s2))
test = 2400+int(lengths)
xaxis=range(2400,test)
yaxis=s
Below is image example x axis is value from 2400- 2500 and y axis is values from some kind of array.


