<< nlp_sentiment text_analytics text_porterstemmer >>

text_analytics >> text_analytics > text_gencloud

text_gencloud

Generate text cloud from a given text-count pairs

Syntax

text_gencloud(tag_text,tag_count)
text_gencloud(tag_text,tag_count,x_spacing,y_spacing,sz_inc,colormap,isbold)

Parameters

tag_text :

A (m x 1) string matrix of the text to generate text cloud

tag_count :

A (m x 1) double matrix correspond to the counts of the text appearance

x_spacing :

Spacing between words in a row, in the range of 0.01 - 0.2

y_spacing :

Spacing between words in col, in the range of 0.01 - 0.2

sz_inc :

Size to increase or decrese for all words, in the range of 1 - 10

colormap :

Colormap could be in 3 format, [r g b], color string such as "blue", and standard colormap such as hsvcolormap(64) etc.

isbold :

To plot the text in bold, %t or %f

Description

This function generate a text cloud base on given text and count.

Examples

AtoZ = strsplit(ascii([65:90,97:122]));
m = 100;
for cnt = 1:m
strlen = round(rand()*10+3);
randstr = round(rand(1,strlen)*51+1);
tag_text(cnt) = strcat(AtoZ(randstr));
end
tag_count = round(rand(m,1).*4 + 1);
text_gencloud(tag_text,tag_count,0.02,0.1,1,hsvcolormap(6),%t);

See also

Authors


Report an issue
<< nlp_sentiment text_analytics text_porterstemmer >>