Production of plots for publication

Hi,

I want to include an rCCA variable plot in a publication but I cannot find a way to produce a plot of nice quality; if I increase the size of the font of the variables so that we can properly read them everything gets on top of each other; is there some kind of jitter option ?

Thanks for your help,

Best

Hi @micro2v,

You might want to perform variable selection using sGCCA and also possibly use cutoff to show just a subset of important variables. The other option is to use a repel functionality to repel the names away from each other such as the following which could again add too many lines.

This can be simply accomplished by replacing the geom_text in plotVar function by ggrepel::geom_text_repel.

If you’re interested in the repel approach let me know as I’m adding some additional features to some visualisation functions.

Hope it helps,

Al

Hi Al,

Thanks for your answer. I already tried to use the cutoff value but I have several points that are too close together in the one’s that I want to keep. The repel approach would be the best for me indeed. I would be happy to learn more about the additional features you propose for that.

Best

Hi @micro2v,

you can do it the primitive way by exporting it as a PDF, and then edit it in e.g. Adobe illustrator. I think this should work really in combination with the repel “function”. You could also set var.names to FALSE and then name the most important variables manually. If you dont have too many variables, you could also use numbers as variable names and add a legend with the real variable names.

Hi @micro2v,

If you’re interested in the repel approach, you can do the following:

You can also use some of the tips provided by @christoa about programmatically dealing with variable names.

Hope it helps

Al

Hi Al,

Thanks, I tried your suggestion but when I run plotVar_repel function, I do not get any plot and I get an error message saying that plotVar2 function does not exist. If I use plotVar, I also get an error message; “closure” type object not indicated.

Thanks for your help

Hi @micro2v,

I just updated the above steps. Can you please re-try?

Thanks

Al

Hi,

Thanks. Now it works, for some unknown reason I had to load the ellipse library to get it working while it’s usually called. The limit of the thing is that it repels among X and Y but not between X and Y so there are still things that are on top of each other… Do you know if there is a way to get it repel both?
Otherwise, I can combine repel with var.names to FALSE on one variable and finish the job with an editor. It’s not my favorite option as it could be seen as data manipulation, but it works.

Thanks for your help

Hi @micro2v

Unfortunately, that would be too specific for us to accommodate. You can somehow export the data.frames used for plots, combine them, and then apply geom_text_repel to remove the overlaps. You’ll then need to tailor the names and colors according to X or Y.

Hope this helps.

Al