I created a simple scatter plot in R with specific RGB color values, for example:
plot(shuffled, p_val, pch=19, col="black", xlim=c(0,100), ylim=c(0,1)) points(ri, p_val, pch=19, col=rgb(96,123,139, 50, maxColorValue=255), xlim=c(0,100), ylim=c(0,1)) points(somo, p_val, pch=19, col=rgb(225,64,5, 50, maxColorValue=255), xlim=c(0,100), ylim=c(0,1))
I would like to use the same color values ββin the above code to generate the shape legend. The code I use looks like this, but I cannot figure out how to match the colors of the points in the graph.
legend("topright", c("Shuffled", "Riffled", "Somosome"), cex=1.0, bty="n", c("black",col=rgb(96,123,139, 50, maxColorValue=255),col=rgb(225,64,5, 50, maxColorValue=255))
Can anyone help? What is wrong with my legend? Thanks!