I am actually trying to reproduce the background (blue isotherm, isohalin) of this graph:
With that kind of file (csv): https://drive.google.com/file/d/1VMjDOFP2ZlVTsNuEVmMwQAxFdLAahdSk/view?usp=sharing
The idea is to plot Depth (y) on Distance (x) from each stations to another. I would like to draw isoclines on it with the "Temp" column.
I tried with ggplot2, and with the geom_area, geom_density2d, or geom_bind2d functions, but I can't succeed making it working. (in this script for example, the error it is showing is Error in f(...) : Aesthetics can not vary with a ribbon
I feel stupid because this is the first time I am using ggplot2.
Could you help me please ?
library(readr)
Tr3 <- read_delim("G:/Tr3.csv", ";", escape_double = FALSE,
col_types = cols(Depth = col_number(),
Distance = col_number(), Temp = col_number()),
trim_ws = TRUE)
library(ggplot2)
theme_set(
theme_bw() +
theme(legend.position = "top"))
f<-ggplot(Tr3, aes(x=Distance, y=Depth))+
geom_area(aes(x=Distance, y=Depth, fill=Temp))
f
Thank you for everything !