X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=plot_frequency_histogram.py;fp=plot_frequency_histogram.py;h=0000000000000000000000000000000000000000;hb=311b300d197536622980f7a837294d8245e326b4;hp=d4a929786760dd9aafd643aa82e02518abf823e1;hpb=d7224fba67d9f99c01bd78ef669c96189686e4c2;p=cipher-tools.git diff --git a/plot_frequency_histogram.py b/plot_frequency_histogram.py deleted file mode 100644 index d4a9297..0000000 --- a/plot_frequency_histogram.py +++ /dev/null @@ -1,15 +0,0 @@ -import matplotlib.pyplot as plt - -def plot_frequency_histogram(freqs, sort_key=None): - x = range(len(freqs)) - y = [freqs[l] for l in sorted(freqs, key=sort_key)] - f = plt.figure() - ax = f.add_axes([0.1, 0.1, 0.9, 0.9]) - ax.bar(x, y, align='center') - ax.set_xticks(x) - ax.set_xticklabels(sorted(freqs, key=sort_key)) - f.show() - -if __name__ == "__main__": - import doctest - doctest.testmod()