-1

I am trying to graph a word frequency dict I have created, the dictionary structure is like:

OrderedDict([('abc', 367), ('abc', 312), ('abc', 286), ('abc', 57)])

However when running in Jupyer Notebook with the code shown below it is coming out poorly formatted.

Any suggestions? Many thanks in advance

a

Alec
  • 8,529
  • 8
  • 37
  • 63
Murchie85
  • 815
  • 2
  • 12
  • 27

1 Answers1

2

I'd suggest using matplotlib.

Using a histogram is the easiest way to do this, but plt.hist(a) requires a to be a list.

If you're using a dictionary, you can use plt.bar():

plt.bar(odict.keys(), odict.values(), width)
Alec
  • 8,529
  • 8
  • 37
  • 63