How to generate colored labels in comparison.cloud?

Asked

Viewed 39 times

2

Below is an example of the code to generate the cloud:

comparison.cloud(tdm, random.order=FALSE,
                 colors = c("tomato", "wheat", "lightblue","lightgreen"))

Words are easily colored with the above command but labels continue with gray background.

inserir a descrição da imagem aqui

  • you can post your solution as a response to your own question. This makes it easier to identify that the problem has been solved.

  • Reinforcing what Rodrigo said, the ideal is to put your answer as an answer and not as an edition of the question. There is no problem - it is actually recommended - the author of the question himself sharing his solution as an answer when he finds it.

  • Thank you so much for the tips! I didn’t know how to put an image in the answer so I ended up editing the question. But now I’ve put it in the right place!

1 answer

1

I found a solution:

I found that to perform such action it is necessary to go to source code. Just go to the R-Forge or check through the console itself.

Then change a line by adding the color parameter col=colors[i] as can be seen below:

rect(x1-.5*wid,y1-.5*ht,x1+.5*wid,y1+.5*ht,col=colors[i], border="transparent")

And when performing the function we will have the colors of the labels changed.

inserir a descrição da imagem aqui

I also want to show how the cor da fonte:

text(x1,y1,word,cex=title.size,col="white")

Browser other questions tagged

You are not signed in. Login or sign up in order to post.