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:
-
image nonzero pixels of an Image object graphics nonzero pixels of a rasterized Graphics object region any 2D geometric RegionQ object - WordCloud has the same options as Graphics, with the following additions and changes:
-
Background Transparent background color to use ColorFunction Automatic color based on weight and word ColorFunctionScaling True whether to scale weight argument of ColorFunction FontFamily "Helvetica" the family of font to use FontSize Automatic range of font sizes FontTracking "Plain" the compression of characters FontWeight Plain the weight of characters to use IgnoreCase True whether to ignore case when computing multiplicities MaxItems Automatic maximum number of words to show PlotRange Automatic range of values to include PlotTheme $PlotTheme overall theme for the plot PreprocessingRules Automatic how to pre-process specific elements RandomSeeding Automatic specify the random seed ScalingFunctions Identity scaling of the weights WordOrientation "Horizontal" orientation of the words to use WordSelectionFunction Automatic function to determine whether to include a word WordSpacings Automatic space to add around each word - 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,None no scaling function (default) Log logarithmic scaling power scaling f use the scaling function f - FontSize can be used to control font sizes from scaled weights with settings:
-
Automatic automatically computed min and max size max automatically computed min size {min,max} explicit min and max size g explicit mapping g between scaled weights and font size - PreprocessingRules can be used to specify how to transform individual words. If the weights are not specified, the preprocessing happens before counting.
- Using WordSelectionFunction->f, the function f takes the words as the first argument. Optionally, the corresponding weight can be given to f as the second argument:
-
#Word or #1 the word si #Weight or #2 the weight wi
Examples
open allclose allBasic Examples (3)
Scope (6)
Options (25)
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