I have simplified the above excellent solution inherently, with more details on the blogpost :
import numpy as np import matplotlib.pyplot as plt numBins = 100 numEvents = 100000 file = 'datafile_100bins_100000events.histogram' histogramSeries = np.fromfile(file, int).reshape(-1,numBins) fig, ax = plt.subplots() rects = ax.bar(range(numBins), np.ones(numBins)*40)
source share