Color management in ggparcoord (from the GGally package)

I am trying hard to program the desired line color for a particular ggparcoord graph. For example, when I create the ggparcoord graph 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)")

Despite the fact that I'm trying to specify the color "green", I get a pink color. How can I control the color of lines in ggparcoord? (By the way, I want all the lines to be the same color as me).

+2
source share
1 answer

You should be able to match the color (dark green) with the corresponding factor level (green) by adding:

+ scale_colour_manual(values = c("green" = "darkgreen"))
+3
source

Source: https://habr.com/ru/post/1624134/


All Articles