The article is quite useful, although the examples near the end are all sequential, not diverging. Maybe the blogger got busy with something else. Anyway, the below demonstrates the 2 recommended diverging palettes.<p><pre><code> n <- 100
m <- matrix(seq(-1, 1, length.out=n), nrow=1)
par(mfrow=c(1, 2))
for (p in c("Purple-Green", "Blue-Red 3")) {
image(m, col=hcl.colors(n+1, palette=p))
mtext(p)
}
</code></pre>
In case it's of interest, I am putting two citations below. The first discusses colour schemes suitable for plotting various oceanographic quantities (or anything, really), and the second deals with an R package that provides these colours chemes.<p>1. Thyng, Kristen, Chad Greene, Robert Hetland, Heather Zimmerle, and Steven DiMarco. “True Colors of Oceanography: Guidelines for Effective and Accurate Colormap Selection.” Oceanography 29, no. 3 (September 1, 2016): 9–13. <a href="https://doi.org/10.5670/oceanog.2016.66" rel="nofollow">https://doi.org/10.5670/oceanog.2016.66</a>.<p>2. Thyng, Kristen M. “The Importance of Colormaps.” Computing in Science Engineering 22, no. 5 (September 2020): 96–102. <a href="https://doi.org/10.1109/MCSE.2020.3006946" rel="nofollow">https://doi.org/10.1109/MCSE.2020.3006946</a>.
Thyng, Kristen, Clark Richards, and Ivan Krylov. “Cmocean: Beautiful Colour Maps for Oceanography,” May 6, 2019. <a href="https://CRAN.R-project.org/package=cmocean" rel="nofollow">https://CRAN.R-project.org/package=cmocean</a>.