I'm trying to figure out the best way to plot several depth profiles with Depth on the y-axis (obviously) and Salinity and Temperature on the x-axis.
It works fine with just Temperature, faceting the graphs by date. But I want to include Salinity in my profiles. Problem is, as temperature values are between 0 and 2°C and Salinity is always >34 I would have to use different scales. I can't figure out a good way to plot both variables over depth for several dates.
I would really appreciate help in this case. The code I used for plotting my profiles without Salinity is this:
scatter <- ggplot(profile, aes(Temp, Depth, colour = Date))
scatter + geom_point(size = 1.5) +
labs(x = "Temperature [°C]", y = "Depth [m]", colour = "Date") +
facet_wrap(~ Date,ncol=5, scales="fixed") +
scale_y_reverse() +
scale_color_discrete(guide="none") +
theme(plot.title = element_text(size = 18, vjust = 1)) +
theme(axis.text.x = element_text(size = 5, angle = 0, colour = 1)) +
theme(axis.text.y = element_text(size = 14, colour = 1)) +
theme(axis.title.x = element_text(size = 18, vjust = -0.5)) +
theme(axis.title.y = element_text(size = 18, angle = 90, vjust = 0.3)) +
theme(axis.line = element_line(size = 0)) +
theme(axis.ticks = element_line(size = 0.1))
If there is no way to do it with ggplot? Other possible solutions?