How to make the chart start on the y-axis through ggplot?

1

Hello,

I'm trying to get the chart below to start on the y-axis, but I'm not getting it. The idea is to bring the first value of the x-axis, the time 6h, to the value 0 of the y-axis. Below is the script used and the image obtained.

Can anyone help me?

Thank you so much !!

ggplot(Transporters_All_DEGs, 
     aes(x=TimePoint,y=log2FC,group=GeneID,colour=Species.x))+
     theme_bw()+
     theme(legend.position="bottom")+
     xlab("")+
     ggtitle("Relative expression")+
     geom_line(alpha = 1/20)+
     scale_color_manual(values=c("#920000", "#6DB6FF"))+
     geom_line(data=x2, aes(x=TimePoint,y=Log2meanFC, group=Species.x,colour=Species.x),size=2)+ 
     scale_colour_manual(name="",breaks=c("organism1","organism2"),labels=c("organism1","organism2"),values=c("#920000", "#6DB6FF"))+
     scale_x_discrete(limits=c("6h","12h","24h"))+
     annotate("text", label = paste(length(unique(Transporters_All_DEGs[which(Transporters_All_DEGs$Species.x == 'organism1'),'GeneID'])),'genes',sep=' '), x = '24h', y = 12, size = 4, colour = "#6DB6FF")+
     annotate("text", label = paste(length(unique(Transporters_All_DEGs[ which(Transporters_All_DEGs$Species.x == 'organism2'),'GeneID'])),'genes',sep=' '), x = '24h', y = 11, size = 4, colour = "#920000")

    
asked by anonymous 01.12.2016 / 19:47

1 answer

1

To start with 0, simply add the command ylim(0,NA) . For example:

ggplot(mtcars, aes(x = disp, y = mpg)) + geom_point() 

Return this chart:

Already,withthistermadded:

ggplot(mtcars,aes(x=disp,y=mpg))+geom_point()+ylim(0,NA)

Return:

    
01.12.2016 / 21:10