I am trying to hard-code the desired line color for a particular ggparcoord plot. For instance, when I create my ggparcoord plot below:
library(GGally)
x = data.frame(a=runif(100,0,1),b=runif(100,0,1),c=runif(100,0,1),d=runif(100,0,1))
x$cluster = "green"
x$cluster2 = factor(x$cluster)
ggparcoord(x, columns=1:4, groupColumn=5, scale="globalminmax", alphaLines = 0.99) + xlab("Sample") + ylab("log(Count)")
Even though I try to specify a color of "green", I get a pink color. How can I control the color of the lines in ggparcoord? (By the way, I want all lines the same color as I specify).
You should be able to map the colour (darkgreen) to a corresponding factor level (green) by adding:
+ scale_colour_manual(values = c("green" = "darkgreen"))
来源:https://stackoverflow.com/questions/29849963/controlling-color-in-ggparcoord-from-ggally-package