Thanks Atpoint Also di you know how I can add a vertical line to my plots?
• 0 views
•
link
Hi all, I am using the following code to make a scatter plot for a few genes. I could be able to change the Y-axis to the same scale using ylim(). But this did not help for the x-axis.
R-code:
dat <- read.csv("mydata.csv", check.name = FALSE, stringsAsFactors = FALSE, header = T)
df <- as.data.frame(dat)
# Basic scatter plot
ex <- melt(df, id.vars="NumericValue")
colnames(ex) <- c("NumericValue","gene", "exprs")
ggplot(data=ex, aes(x="NumericValue", y=exprs)) + geom_point() +
facet_wrap(~ gene, scales = "free") +
ylim(0, 15) +
theme_bw()
Resutlted plot:
Log in to answer this question.