WordCloud

WordCloud[{s1,s2,}]

generates a word cloud graphic in which the si are sized according to their multiplicity in the list.

WordCloud[{w1s1,}]

generates a word cloud in which the si are sized according to the weights wi.

WordCloud[s1w1,]

also generates a word cloud in which the si are sized according to the weights wi.

WordCloud[{w1,w2,}{s1,s2,}]

also generates a word cloud in which the si are sized according to the weights wi.

WordCloud[{{s1,w1},{s2,w2},}]

also generates a word cloud in which the si are sized according to the weights wi.

WordCloud[data,shape]

fits the word cloud into the region defined by shape.

Details and Options

  • Word clouds are also known as tag clouds and are often used to visualize popularity of phrases or words in a given context.
  • The si can be strings or any other expression. They are rendered in the word cloud however they would normally be displayed.
  • WordCloud returns a Graphics object where each object si is displayed with linear dimensions proportional to its weight.
  • WordCloud["string"] generates a word cloud of the words in "string".
  • Each of the si can be given a symbol wrapper, which affects its behavior or rendering:
  • Annotation[si,label]provide an annotation
    Button[si,action]define an action to execute when clicked
    EventHandler[si,]define a general event handler
    Hyperlink[si,uri]create a hyperlink
    PopupWindow[si,cont]attach a popup window
    Rotate[si,θi]rotate by θi radians
    StatusArea[si,label]display in the status area when moused over
    Style[si,]show using the specified styles
    Tooltip[si,label]attach an arbitrary tooltip
  • Data not given in the form above is taken to be missing and will be ignored.
  • The cloud shape mask can be given in the following forms:
  • imagenonzero pixels of an Image object
    graphicsnonzero pixels of a rasterized Graphics object
    regionany 2D geometric RegionQ object
  • WordCloud has the same options as Graphics, with the following additions and changes:
  • BackgroundTransparentbackground color to use
    ColorFunctionAutomaticcolor based on weight and word
    ColorFunctionScalingTruewhether to scale weight argument of ColorFunction
    FontFamily"Helvetica"the family of font to use
    FontSizeAutomaticrange of font sizes
    FontTracking"Plain"the compression of characters
    FontWeightPlainthe weight of characters to use
    IgnoreCaseTruewhether to ignore case when computing multiplicities
    MaxItemsAutomaticmaximum number of words to show
    PlotRangeAutomaticrange of values to include
    PlotTheme$PlotThemeoverall theme for the plot
    ScalingFunctionsIdentityscaling of the weights
    WordSpacingsAutomaticspace to add around each word
    WordOrientation"Horizontal"orientation of the words to use
  • With ImageSizeAutomatic, the actual font sizes used are specified by FontSize, and the computed ImageSize will vary to fit the word cloud.
  • With ImageSize fully specified, rescaled font sizes are used so that the resulting word cloud will fit in the specified image size.
  • ScalingFunctions is applied to weights wi, with settings:
  • Identity,Noneno scaling function (default)
    Loglogarithmic scaling
    #^alpha&power scaling
    fuse the scaling function f
  • FontSize can be used to control font sizes from scaled weights with settings:
  • Automaticautomatically computed min and max size
    maxautomatically computed min size
    {min,max}explicit min and max size
    gexplicit mapping g between scaled weights and font size

Examples

open allclose all

Basic Examples  (3)

Word cloud of weighted strings:

In[3]:=
Click for copyable input
In[4]:=
Click for copyable input
Out[4]=

Tooltip every word of the word cloud:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=

Create a word cloud using a given shape:

In[1]:=
Click for copyable input
In[2]:=
Click for copyable input
Out[2]=

Scope  (6)

Options  (19)

Applications  (8)

Properties & Relations  (2)

Possible Issues  (1)

Interactive Examples  (1)

Neat Examples  (1)

See Also

ImageCollage  Snippet  Text  Counts  WordCounts  LetterCounts  WordFrequency  Tally  ToUpperCase  ToLowerCase  StringCases  TextCases  WordData  BubbleChart

Introduced in 2015
(10.1)
| Updated in 2016
(11.0)