I'm doing a R plot and to each set of data I want it to be shown in a different color. To do that I'm using scale_color_manual()
. The thing works perfectly fine with the first nine or ten curves, but in the last two ones, ggplot do not set the color I had chose.
I'll put the code down here and a copy of the plot I'm getting so you can see what I'm talking about. As it is a lot of different set of data, I will not post it here, but the problem is at the last two curve called here as "Saída R11" and "Saída R12".
ggplot() +
geom_point(data = C1D1, mapping = aes(x <- V2, y = V1V2/R, colour = "Saída R1"), size = a) +
geom_point(data = C1D2, mapping = aes(x <- V2, y = V1V2/R, colour = "Saída R2"), size = a) +
geom_point(data = C1D3, mapping = aes(x <- V2, y = V1V2/R, colour = "Saída R3"), size = a) +
geom_point(data = C1D4, mapping = aes(x <- V2, y = V1V2/R, colour = "Saída R4"), size = a) +
geom_point(data = C1D5, mapping = aes(x <- V2, y = V1V2/R, colour = "Saída R5"), size = a) +
geom_point(data = C1D6, mapping = aes(x <- V2, y = V1V2/R, colour = "Saída R6"), size = a) +
geom_point(data = C1D7, mapping = aes(x <- V2, y = V1V2/R, colour = "Saída R7"), size = a) +
geom_point(data = C1D8, mapping = aes(x <- V2, y = V1V2/R, colour = "Saída R8"), size = a) +
geom_point(data = C1D9, mapping = aes(x <- V2, y = V1V2/R, colour = "Saída R9"), size = a) +
geom_point(data = C1D10, mapping = aes(x <- V2, y = V1V2/R, colour = "Saída R10"), size = a) +
geom_point(data = C1D11, mapping = aes(x <- V2, y = V1V2/R, colour = "Saída R11"), size = a) +
geom_point(data = C1D12, mapping = aes(x <- V2, y = V1V2/R, colour = "Saída R12"), size = a) +
annotate("rect", fill = "#D1C5CF", alpha = 0.4, xmin = -0.05, xmax = xcomp, ymin = yMIN, ymax = yMAX) +
annotate("rect", fill = "#B3C5DD", alpha = 0.16, xmin = xcomp, xmax = 3.9, ymin = yMIN, ymax = yMAX) +
annotate(geom="text", x=0.16, y=0.038, label="Região", color="#FF85D4") +
annotate(geom="text", x=0.135, y=0.036, label="Saturada", color="#FF85D4") +
annotate(geom="text", x=3.78, y=0.038, label="Região", color="#6B7AFF") +
annotate(geom="text", x=3.81, y=0.036, label="Ativa", color="#6B7AFF") +
geom_line(data = ivCurve, mapping <- aes(x <- x1, y<-y1)) +
scale_colour_manual(TeX('$Corrente\\, I_{B}\\, (?A)$'),
breaks = c("Saída R1","Saída R2","Saída R3","Saída R4","Saída R5","Saída R6","Saída R7","Saída R8","Saída R9","Saída R10", "Saída R11", "Saída R12"),
values = c("#000000","#B1DF1C","#88FB0C","#41F710","#09F668","#03F8C7","#0AB8F8","#900BF6","#CF0FE8","#EE13C6", "purple","red")) +