I tried to find something similar, and the closest I could find was this , which helped me extract and process the data, but now I canβt figure out how to rebuild the histogram. I have some array of stresses, and I first built a histogram of the appearance of these stresses. Instead, I want to make a histogram of events per hour (so that the y axis of the normal histogram is divided by the number of hours that I took the data), and then rebuild the histogram using y data.
I have an array that contains the number of events per hour (consisting of the original y axis from pyplot.hist divided by the number of hours the data was received) and the bins from the histogram. I compiled this array using the following code (taken from the answer linked above):
import numpy import matplotlib.pyplot as pyplot mydata = numpy.random.normal(-15, 1, 500)
This code does not exactly match what is happening in my code; my data consists of 1000 arrays of 1000 data points each (voltage). I made histograms of this, which gives me the number of occurrences of a given voltage range (or bin width). All I want to do is rebuild the histogram of the number of events per hour (so yaxis histogram / 5 hours) with the same original bin width, but when I divide hist1[0]/5 and repeat it like this, the "bin width" is wrong .
I feel that there should be an easier way to do this, instead of manually rewriting my own histograms.
Thanks in advance, and I'm really sorry if I missed something obvious.
The problem illustrated by the output of my sample code AND my raw data:
Top charts : code snippet output.
Lower charts . My actual data. 
source share