Hello,
I have recently started working in RStudio.
I'm using ggplot2 to have profile of elements concentration (x axis) with depth (y axis) but I have a little problem with Y axis.
1 - I need to intercept axis x and y at 0. How could I do it? Here's my code
DOCprofil <- ggplot(tab_Dora_PW_1, aes(x= DOC , y= Depth)) +
geom_path(linetype= 3, size = 0.2) +
geom_point(col= "slategray1", size = 2)+
scale_x_continuous(name = "DOC (mg/L)", position= "top", limits = c(0, 40),expand=c(0,0)) +
scale_y_continuous(limits = c(-30,30),expand=c(0,0))
2- Actually, my depth range is between 600 cm till - 30 cm and I need to present them in the same profile to describe a certain behavior. Yes, it's a huge marge of interval but I need my y axis to be from 600 to -30. On excel, I have these profile (see figure)
and my Rcode is:
DOCprofil <- ggplot(tab_Dora_PW_1, aes(x= DOC , y= Depth)) +
geom_path(linetype= 3, size = 0.2) +
geom_point(col= "slategray1", size = 2)+
scale_x_continuous(name = "DOC (mg/L)", position= "top", limits = c(0, 40),expand=c(0,0)) +
scale_y_discrete(limits = c(-30,-20,-10,0,10,20,30,100,350,700))
So I used scale_y_discrete by changing "limits" and "breaks" but It's always not clear like the profile on excel sheet.
So I would really appreciate some solutions for these issues.
Thanks a lot