Hello,
I would like to plot my Temp according to my depth using a geom_line with each line = an Area
y = depth and x = temp
df <- tribble(
~Area, ~station, ~depth, ~Temp,
"A1","St1",10, 2.5,
"A1","St1",20, 2.8,
"A1","St1",30, 2.6,
"A1","St2",10, 2.6,
"A1","St2",20, 2.48,
"A1","St2",30, 2.54,
"A2","St3",10, 2.8,
"A2","St3",20, 2.74,
"A2","St3",30, 3.05,
"A2","St4",10, 3.18,
"A2","St4",20, 1.05,
"A2","St4",30, 2.06,
"A3","St5",10, 1.26,
"A3","St5",20, 3.15,
"A3","St5",30, 2.87,
)
I did this but it's doesn't work.. I think it's because in my area I have station with the same depth
df %>%
ggplot(aes( x=Temp,y=depth, color=Area)) +
geom_line() +
ylab(label = "Depth(m)") +
xlab(label = "Temperature(°C)") +
scale_y_reverse()
How can I do ?