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: [List of all options]
-
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 seeding for random word orientation 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.
- FontSize can be used to control font sizes from scaled weights with settings:
-
Automatic automatic size range max explicit max size and automatic min size {min,max} explicit min and max size g explicit mapping function g » - 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 a word as its first argument and that word's weight as its second argument: »
-
#Word or #1 the word si #Weight or #2 the weight wi -
AlignmentPoint Center the default point in the graphic to align with AspectRatio Automatic ratio of height to width Axes False whether to draw axes AxesLabel None axes labels AxesOrigin Automatic where axes should cross AxesStyle {} style specifications for the axes Background Transparent background color to use BaselinePosition Automatic how to align with a surrounding text baseline BaseStyle {} base style specifications for the graphic ColorFunction Automatic color based on weight and word ColorFunctionScaling True whether to scale weight argument of ColorFunction ContentSelectable Automatic whether to allow contents to be selected CoordinatesToolOptions Automatic detailed behavior of the coordinates tool Epilog {} primitives rendered after the main plot 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 FormatType TraditionalForm the default format type for text Frame False whether to put a frame around the plot FrameLabel None frame labels FrameStyle {} style specifications for the frame FrameTicks Automatic frame ticks FrameTicksStyle {} style specifications for frame ticks GridLines None grid lines to draw GridLinesStyle {} style specifications for grid lines IgnoreCase True whether to ignore case when computing multiplicities ImageMargins 0. the margins to leave around the graphic ImagePadding All what extra padding to allow for labels etc. ImageSize Automatic the absolute size at which to render the graphic LabelStyle {} style specifications for labels MaxItems Automatic maximum number of words to show Method Automatic details of graphics methods to use PlotLabel None an overall label for the plot PlotRange Automatic range of values to include PlotRangeClipping False whether to clip at the plot range PlotRangePadding Automatic how much to pad the range of values PlotRegion Automatic the final display region to be filled PlotTheme $PlotTheme overall theme for the plot PreprocessingRules Automatic how to pre-process specific elements PreserveImageOptions Automatic whether to preserve image options when displaying new versions of the same graphic Prolog {} primitives rendered before the main plot RandomSeeding Automatic specify the seeding for random word orientation RotateLabel True whether to rotate y labels on the frame ScalingFunctions Identity scaling of the weights Ticks Automatic axes ticks TicksStyle {} style specifications for axes ticks 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
List of all options
Examples
open allclose allBasic Examples (3)
Scope (6)
Data (4)
Shape (1)
Options (25)
ColorFunction (1)
The default color function is ColorData["DarkRainbow"]:
ColorFunctionScaling (2)
By default, weights are scaled to fit in the range 0 and 1:
Scaled weights are not suitable when used with indexed colors:
Use ColorFunctionScaling->False:
FontSize (4)
FontTracking (1)
The default is FontTracking->"Plain":
FontWeight (1)
The font weight is Plain by default:
IgnoreCase (3)
By default, cases are ignored:
Differentiate between uppercase and lowercase letters:
With weighted strings and IgnoreCase->True, the total weight of the identical words is used:
With IgnoreCase->True, each word appears using the capitalization of its first occurrence:
ImageSize (1)
ImageSize controls the display size only. The default display size is computed automatically:
PreprocessingRules (3)
ScalingFunctions (1)
WordOrientation (1)
WordSelectionFunction (2)
Select strings based on their length:
By default, elements are selected based on decreasing weight order up to the MaxItems value:
Applications (8)
Basic Applications (4)
Summarize a webpage in a word cloud:
Put selected words in the shape of the US map:
Create a word cloud of all artworks of Picasso:
Extract name, area, and an image corresponding to each artwork:
Create the word cloud and use images as tooltips:
Compute and visualize different identifications of an image:
Word Selection (1)
Properties & Relations (2)
By default, a single string is processed using TextWords and DeleteStopwords:
Explicitly split the words to avoid deletion of stopwords:
By default, the capitalization of words is preserved. With multiple occurrences, the first instance is used:
Possible Issues (1)
Text
Wolfram Research (2015), WordCloud, Wolfram Language function, https://reference.wolfram.com/language/ref/WordCloud.html (updated 2017).
CMS
Wolfram Language. 2015. "WordCloud." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2017. https://reference.wolfram.com/language/ref/WordCloud.html.
APA
Wolfram Language. (2015). WordCloud. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/WordCloud.html