Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

CET Perceptually Uniform Colour Maps for R

NotificationsYou must be signed in to change notification settings

coatless-rpkg/cetcolor

Repository files navigation

CRAN_Status_BadgeTravis-CI Build Status

CET Perceptually Uniform Colour Maps (cetcolor)

Thecetcolor package is designed to bring to R the colour maps created byPeter Kovesi that avoid points of locally high colour contrast leading to the perception of false anomalies in your data when there is none. The colour maps have been designed to avoid this phenomenon by having uniform perceptual contrast over their whole range.

Sample

# install.packages("devtools")# Install the packagedevtools::install_github("coatless/cetcolor")
# Load the Librarylibrary("cetcolor")# Get RGB Hexadecimals for graphingcet_pal(5,name="blues")# Sample use with ggplot2library("ggplot2")ggplot(faithfuld, aes(waiting,eruptions))+  geom_raster(aes(fill=density))+  theme_bw()+ theme(panel.grid=element_blank())->glibrary("gridExtra")# Frequently used colour maps have "nicknames" see ?cet_color_mapsgrid.arrange(g+ scale_fill_gradientn(colours= cet_pal(5,name="fire")),g+ scale_fill_gradientn(colours= cet_pal(5,name="inferno")),g+ scale_fill_gradientn(colours= cet_pal(5,name="blues")),g+ scale_fill_gradientn(colours= cet_pal(5,name="kgy")),ncol=2,nrow=2)
# Show a panel of possible values (without nicknames)display_cet_all()

References

CET

R Colour Palettes

  • viridis (Source)
    • Provides MATLAB perceptually uniform colour maps in a manner that is similar to this package.
  • RColorBrewer (Source)
    • Function interface naming, e.g.cet_pal(n, name), and colour map displays.
  • scales andggplot2
    • Proper ways to interface colour palettes withggplot2 as shown forRColorBrewer.

Future

  • Allow for n > 256.
  • Provide hooks for ggplot2 gradient and discrete scales
  • Port over the Peter's generation code from Julia / MATLAB to R.

[8]ページ先頭

©2009-2025 Movatter.jp