Plot Indiv Black and White Color

Hi mixOmics team, is it possible to create basic color, such as black and white only, in the PlotIndiv function? Since, some publisher does not accept colorful graphics in the manuscript.

Thank you for developing mixOmics, I am so glad to always use and explore this package for my study.

Regards,

Fawzan

Hi @aurum,

Thanks for your post. Can you please provide a reproducible example using mixOmics data for which you’d like to see a black and white theme?

Best,

Al

Hi Al,
this is the example using mixOmics dataset

library(mixOmics)
data(nutrimouse)
X ← nutrimouse$gene
Y ← nutrimouse$lipid

myspls ← spls(X,Y, keepX = c(25, 25), keepY = c(5,5))

plotIndiv(myspls, group = nutrimouse$genotype,
rep.space = “XY-variate”, legend = TRUE,
legend.title = ‘Genotype’,
ind.names = F,
title = ‘Nutrimouse: sPLS’, ellipse = T)
The result of plotIndiv are colorful graph, however I need this to be a grayscale or black white with pattern. Is it possible?

Thanks

Hi @aurum,

Please see below.

suppressPackageStartupMessages(library(mixOmics))
data(nutrimouse)
X <- nutrimouse$gene
Y <- nutrimouse$lipid

myspls <- spls(X,Y, keepX = c(25, 25), keepY = c(5,5))

plotIndiv(myspls, group = nutrimouse$genotype,
          rep.space = 'XY-variate', legend = TRUE,
          legend.title = 'Genotype',
          ind.names = F,
          title = 'Nutrimouse: sPLS', ellipse = T, col.per.group = c('grey20', 'grey60'))

Created on 2020-10-30 by the reprex package (v0.3.0)

Al,
Thanks a lot for introducing me to this R shades of grey…
Regards,