I am trying to create a word cloud in python using pytagcloud. With my current cloud, I can generate a cloud, but the words all are the same size. How can I alter the code so that my words' sizes appear in relation to their frequency?
My text file already has the words with their respective frequency counts already in it, the format is like "George, 44" newline "Harold, 77", newline, "Andrew, 22", newline, etc. However, when it displays the word, it also displays the frequency with it.
with open ("MyText.txt", "r") as file:
Data =file.read().replace('\n', '')
tags = make_tags(get_tag_counts(Data), maxsize=150)
create_tag_image(tags, 'Sample.png', size=(1200, 1200),background=(0, 0, 0, 255), fontname='Lobstero', rectangular=True)
import webbrowser
webbrowser.open('Sample.png')