Hi All,
My data frame has two columns: Gene names and Z scores. I am using ggplot2 package to make a scatter plot. I was able to create the plot but I don't know how to show only specific gene names on the plot and also how to change the color of the gene names shown.
Here is what I am using:
library(ggplot2)
Data <- read.csv("Data.csv", header = TRUE)
ggplot(Data, aes(x = Count, y = Z_Score))
Lets say I want to show genenames "Gene1", "Gene2", "Gene3" on the plot and in "red", "blue", "green" respectively.
Many Thanks, Hamid
This is definitely a https://stackoverflow.com/ kind of question. By the way, you should bring a concrete example dataset. Your information is not enough.
You can find various generic solutions on stackoverflow (as pointed below) or stdha.com. Basically, you would have to have Gene names as factors and
color
inaes
ascolor=Gene
. However, if you have 1000 genes and you want to give each of them a specific color, you will run into problem of color scale! You will end up choosing some sort of gradient, which will make it harder to understand if you are trying to display specific gene or some sort of continuous (gene expression) information!!