I am starting from this ggplot :
library(ggplot2)
library(reshape2)
data <- read.delim(textConnection("
Groups Time_1 Time_2 Time_3 Time_4
A 63.8 60.6 65.2 66.6
B 9.4 14.0 11.1 7.5
C 7.4 8.5 6.9 8.6
D 13.9 8.4 7.9 11.4
E 1.4 3.8 5.0 1.5
F 0.2 0.2 0.2 0.2
G 1.8 2.5 1.8 2.7
H 1.0 0.9 0.9 1.1
I 45.0 42.0 49.0 38.0
J 1.0 1.1 0.9 0.5
K 0.1 2.0 6.5 1.0
L 0.5 0.9 0.5 0.2
M 0.2 0.2 0.1 0.3"), sep = " ", header = T)
data_melt <- melt(data, id.var = "Groups")
data_melt$value <- as.numeric(data_melt$value)
ggplot <- ggplot(data=data_melt, aes(x=variable, y=value, group = Groups, color = Groups)) + geom_point(size = 1) + geom_line(size = 1)
ggplot
However, as you can see on the graph, the color code isn't optimal and it's hard to distinguish which color correponds to which groups, even when the curves are well separated:
Unfortunately, I always have between 10 and 13 groups, and I've spent some time looking at R color palettes but usually they're too small.
So I'm looking for ideas about how to have a better color code to improve my graph, any clue would be helpful !