Closed Kevin-Mattheus-Moerman closed 2 years ago
I'm sure we can make something similar, or even better, for example, this picture. To do that, you need a weight-ordered word list and a corresponding color list. If you pass a Vector
to the colors
argument, the item will be used one by one in cycle.
So if you want the style of your second picture, you may need to set colors = [repeat(["gray"], 100); repeat(["red"], 100); repeat(["purple"], 100); repeat(["orange"], 100); repeat(["green"], 100)]
(suppose the length of word list is 500).
Of course, you can set a more fine grain gradient colors (like my picture). You can refer to my approach.
That did the trick thanks!
I added a new function WordCloud.gradient
to make it easy to generate gradients. Maybe I'll add an example sometime.
Thanks for this package. I am testing it at the moment and was not able to find out how to set word colors such that the color depends on the weight (based on occurrence). This could perhaps create a nice gradient of color rather than the random look I seem to get.
I've reproduced the code I'm using at the moment here:
Currently I get something like:
But I would prefer if it would look more like this: