11
$\begingroup$

By default, WordCloud removes duplicates (or rather counts the number of times they occur, and uses that as the weight).

enter image description here

Is there a way to turn this feature off, and allow a word to appear more than once in the output?

$\endgroup$
18
$\begingroup$

Make it render the same but be a different thing:

RawBoxes @ TagBox[ToBoxes[#], Unique@#] & /@ {foo, foo, foo} // WordCloud

enter image description here

Or shorter but less documented:

DynamicName[#, Unique@#] & /@ {foo, foo, foo} // WordCloud
$\endgroup$
18
$\begingroup$
lst = {"foo","foo","foo"};

WordCloud  @ MapIndexed[Interpretation] @ lst

enter image description here

Also

WordCloud  @ MapIndexed[DynamicWrapper] @ lst

WordCloud @ Map[Labeled[#, Invisible @ Unique @ #]&] @ lst

WordCloud @ MapIndexed[StringJoin[#, ConstantArray["\[InvisibleSpace]", #2[[1]]]]&] @ lst
$\endgroup$
1
$\begingroup$
WordCloud[NestList[HoldForm, "foo", 2]]

WordCloud[NestList[Row@*List, "foo", 2]]

enter image description here

$\endgroup$
  • $\begingroup$ How does this work? $\endgroup$ – lirtosiast Aug 19 at 16:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.