1 import matplotlib
.pyplot
as plt
3 def plot_frequency_histogram(freqs
, sort_key
=None):
5 y
= [freqs
[l
] for l
in sorted(freqs
, key
=sort_key
)]
7 ax
= f
.add_axes([0.1, 0.1, 0.9, 0.9])
8 ax
.bar(x
, y
, align
='center')
10 ax
.set_xticklabels(sorted(freqs
, key
=sort_key
))
13 if __name__
== "__main__":