import matplotlib.pyplot as plt import numpy as np
def plot_hist(file, bins=256): plt.hist(np.fromfile(file, np.uint8), bins=bins) plt.show()
plot_hist('pi')