Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wordcloud with a specific shape [closed]

Suppose, I have a dataframe which contains some words with their frequencies. I want to create a wordcloud in R with the words inside the shape of a logo, for example, the twitter logo just like this: enter image description here

For the wordcloud, there is a package named wordcloud2 and running the demo only gives a square image of the words. How would I add a specific image of my choice to be the shape of the wordcloud?

wordcloud2(demoFreq) only ouputs a square.

like image 964
Marco Fumagalli Avatar asked Feb 03 '17 16:02

Marco Fumagalli


People also ask

Can you make a word cloud in a specific shape?

You can pick a shape, select colors and fonts, and control how WordClouds generates the cloud. Artists will especially appreciate this feature. You can draw your own image with a transparent background, then upload it to WordClouds.

What is Stopwords in WordCloud?

From the wordcloud documentation: stopwords : set of strings or None. The words that will be eliminated. If None, the build-in STOPWORDS list will be used.

What happened to wordle word clouds?

The original Wordle word cloud tool no longer exists, but there are others that still do and are still helpful. Here's a handful of them to try. Paste your text into Analyze My Writing and it will generate a ton of information about your writing.


1 Answers

You can use wordcloud2 package for that. It allows you to use any image as the mask. Just put in the working directory and link to it using figpath. Below is the code I used to make the wordcloud. Below that is the wordcloud. Here is the image I used as the mask.

library(wordcloud2)
wordcloud2(demoFreq, figPath = "twitter.jpg")

enter image description here

like image 111
d.b Avatar answered Sep 30 '22 12:09

d.b