TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Coloring in R's Blind Spot

46 pointsby Amorymeltzerabout 2 years ago

3 comments

bluenose69about 2 years ago
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 &lt;- 100 m &lt;- matrix(seq(-1, 1, length.out=n), nrow=1) par(mfrow=c(1, 2)) for (p in c(&quot;Purple-Green&quot;, &quot;Blue-Red 3&quot;)) { image(m, col=hcl.colors(n+1, palette=p)) mtext(p) } </code></pre> In case it&#x27;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:&#x2F;&#x2F;doi.org&#x2F;10.5670&#x2F;oceanog.2016.66" rel="nofollow">https:&#x2F;&#x2F;doi.org&#x2F;10.5670&#x2F;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:&#x2F;&#x2F;doi.org&#x2F;10.1109&#x2F;MCSE.2020.3006946" rel="nofollow">https:&#x2F;&#x2F;doi.org&#x2F;10.1109&#x2F;MCSE.2020.3006946</a>. Thyng, Kristen, Clark Richards, and Ivan Krylov. “Cmocean: Beautiful Colour Maps for Oceanography,” May 6, 2019. <a href="https:&#x2F;&#x2F;CRAN.R-project.org&#x2F;package=cmocean" rel="nofollow">https:&#x2F;&#x2F;CRAN.R-project.org&#x2F;package=cmocean</a>.
评论 #35900825 未加载
azalemethabout 2 years ago
R gets a lot of hate, not least because it&#x27;s quite annoying to parallelize at times, but I think it&#x27;s a lovely free language with an enormous ecosystem and a lot of highly mathematically literate users, oft based at universities, and oft beholden unto no corporate interests. Arguably that&#x27;s also R&#x27;s greatest weakness too.<p>This is quite a nice modernisation of colour palettes in base R, which otherwise does feel a bit like it&#x27;s from the 1990s. Colour palettes are particularly important for (not) biasing data representations -- a great paper about it is <a href="https:&#x2F;&#x2F;www.nature.com&#x2F;articles&#x2F;s41467-020-19160-7" rel="nofollow">https:&#x2F;&#x2F;www.nature.com&#x2F;articles&#x2F;s41467-020-19160-7</a>.
评论 #35898750 未加载
评论 #35899177 未加载
评论 #35900700 未加载
uptownfunkabout 2 years ago
Many years later still one of the best languages I’ve ever used for large scale data science applications.