user1603472
user1603472

Reputation: 1458

Creating a wordcloud with matplotlib

Im trying to create a wordcloud with Matplotlib. Essentially I am able to put text at arbitrary locations in my grid, but need to work out a way of preventing them from colliding. In relation to this I am stuck on two questions:

  1. What is the unit of fontsize?

  2. How do I transfer the "fontsize" of the text to units in my figure, so I can mark them as used? That is, how do I know how much space each letter will take up in my grid? Ideally I would not have to mark out a whole rectangle around each word, but only the pixels they actually use as available for other words.

Upvotes: 3

Views: 4657

Answers (1)

user3494103
user3494103

Reputation:

I'm not sure about how to do it with matplotlib but I have used this in the past: http://peekaboo-vision.blogspot.co.uk/2012/11/a-wordcloud-in-python.html

Upvotes: 2

Related Questions