scatter plot change in x, y axis

scatter plot change in x, y axis

0

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.

  1. Does anyone know how I can change the values of the x-axis?
  2. I want to see the real values (the same scale for all scatters). Here I don’t know why the dots are collected in one place?
    Also, how can I draw a vertical line that crosses the x-axis from a specific value such as 80 in the x-axes?

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:

DEGs-Specific


scatter


code


expression


R

• 31 views

1 hour ago by


Rob

&utrif;

120

Read more here: Source link