This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Graph for PCs, can't apply colours to the points.

Hi,

I need help in drawing the graphs by using the R.

I have generated the graphs for genes by following code as but colours for each plot are not appeared in graph.

plot(pc$x[,1:2], pch = 21, bg = pData(bg_data)$Color, cex = 2, ylim = c(-100, 100), xlim = c(-100, 100), xlab = "PC1", ylab = "PC2", cex.lab = 1.4, cex.axis = 1.3)
r rna-seq

1 answer

Read the docs. bg sets the background color of the points, To set the point color, use col.

Log in to answer this question.