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