I am trying to create a contour plot. I would like to have depth on the Y-axis and time on the X-axis. Right now this is the code that I am using:
par <- ggplot(up_PAR, aes(Time.hour.of.the.day., Depth, z = PAR))
parplot <- par +
stat_contour(bins=20, aes(colour=..level..))+
scale_colour_gradient(limits=c(0.000842, 0.00000000195),low="black", high="black") +
scale_y_reverse()+
theme_bw()+
theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank())+
xlab("Hour of the Day")+
ylab("Depth(m)")+
ggtitle("Downwelling PAR (photons/m2/s), January 22nd")
direct.label(parplot)
However, I would like to extend the Depth axis to span from 0-30m. My dataset goes to 175m, but I am only interested in showing the top of the water column.
I know that I can use scale_y_continuous(limit=c(0,30))
but since I've already reversed my axis, and would like to keep it that way, I am unable to also set the limits of the axis.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…