Skip to content

Instantly share code, notes, and snippets.

@fnielsen
Created September 19, 2014 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fnielsen/d46452f831840dd5a386 to your computer and use it in GitHub Desktop.
Save fnielsen/d46452f831840dd5a386 to your computer and use it in GitHub Desktop.
Tag cloud with Python
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