Created
September 19, 2014 15:40
-
-
Save fnielsen/d46452f831840dd5a386 to your computer and use it in GitHub Desktop.
Tag cloud with Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import Counter | |
from nltk.corpus import brown | |
from pytagcloud import create_tag_image, make_tags | |
from PIL import Image | |
# Developed from https://pypi.python.org/pypi/pytagcloud | |
create_tag_image(make_tags(Counter(brown.words()).most_common(150), maxsize=300), 'cloud.png', size=(900, 600), fontname='Lobster') | |
Image.open('cloud.png').show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment