paleolimbot / ggoce

Plot 'oce' objects using 'ggplot2'
https://paleolimbot.github.io/ggoce
Other
4 stars 1 forks source link

Add `annotation_isopycnal()` to draw density "contours" under a TS plot #2

Closed paleolimbot closed 3 years ago

paleolimbot commented 3 years ago

See oce::drawIsopycnals() ( https://github.com/dankelley/oce/blob/7f1fc09785723005d23195c076e9b4462993e2cd/R/ctd.R#L4674-L4746 )

paleolimbot commented 3 years ago

See also:

https://github.com/MikkoVihtakari/WaterMass/blob/main/R/ts_plot.R

https://github.com/MikkoVihtakari/PlotSvalbard/blob/master/R/ts_plot.R

paleolimbot commented 3 years ago

Also:

https://github.com/Davidatlarge/ggTS

paleolimbot commented 3 years ago

Making progress!

library(ggplot2)
library(ggoce)

data(ctd, package = "oce")

ggplot(ctd, aes(salinity, temperature)) +
  geom_isopycnal() +
  geom_point()
#> Loading required package: oce
#> Loading required package: gsw
#> Loading required package: testthat
#> Warning: package 'testthat' was built under R version 4.0.4
#> Loading required package: sf
#> Linking to GEOS 3.8.0, GDAL 3.0.4, PROJ 6.3.1

Created on 2021-04-29 by the reprex package (v2.0.0)