I've created a simple word frequency calculator in python 3.2. Now I want to create a plot to visualize the results. I want to add the most frequent words to the y axis and the x axis would contain the frequency results. How can I add text instead of numbers to a pylab axis? Thanks in advance!
Take the 2-minute tour
×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
|
I am going to assume, that because you want to display the frequencies on x-axis instead of the y-axis, that you want a horizontal bar-plot. Adjusting the labels to print on the x-axis instead simply requires you to
use the
This will result in the following chart (but there probably is a better way
that will not require you to fiddle with spacing where to display you y-labels).
Actually thinking a bit more about it - I think something like the following is more what you had in mind (I think I should stop now, as it inevitably shows that I am laughably inexperienced using matplotlib):
|
|||||
|