SlideShare una empresa de Scribd logo
1 de 105
Descargar para leer sin conexión
Color Palettes in R
Author: Michel Alves dos Santos
[[www.michelalves.com :: http://www.lcg.ufrj.br/Members/malves/ ]]
#------------------------------------------------------------------------------#
# Color Palettes.
# Date : 20 February, 2012
# Author : Michel Alves dos Santos
#------------------------------------------------------------------------------#
#------------------------------------------------------------------------------#
# Loading required libraries
#------------------------------------------------------------------------------#
require(RColorBrewer)
#------------------------------------------------------------------------------#
# Color Settings
#------------------------------------------------------------------------------#
my.palette.nc <- 255 # number of colors
my.palette.rc <- 1:205 # range of colors
#-------------------------------------------------------------------------------
# Color Palettes - Definition of names and component colors
#-------------------------------------------------------------------------------
# Matlab falshy jet color
jet.colors.palette <- c("#00007F", "blue", "#007FFF", "cyan", "#7FFF7F", "yellow", "#FF7F00", "red", "#7F0000")
# Pastel palette
my.pastel.palette <- rev(c("#62739F", "#8DABBD", "#AB9EB0", "#FFF0A7", "#F4BAA4"))
# Sequential RColorBrewer: for more information type display.brewer.all() or display.brewer.all(type="seq")
# The sequential palettes names are: Blues BuGn BuPu GnBu Greens Greys Oranges OrRd PuBu PuBuGn PuRd
# Purples RdPu Reds YlGn YlGnBu YlOrBr YlOrRd. All the sequential palettes are available in variations from 3
# different values up to 9 different values.
YlGnBuPalette <- brewer.pal(9, "YlGnBu")
YlOrBrPalette <- brewer.pal(9, "YlOrBr")
YlOrRdPalette <- brewer.pal(9, "YlOrRd")
# Divergent RColorBrewer: type display.brewer.all(type="div"). The diverging palettes are: BrBG PiYG PRGn
# PuOr RdBu RdGy RdYlBu RdYlGn Spectral. All the diverging palettes are available in variations from 3
# different values up to 11 different values.
SpectralPalette <- brewer.pal(11, "Spectral")
RdYlGnPalette <- brewer.pal(11, "RdYlGn")
RdYlBuPalette <- brewer.pal(11, "RdYlBu")
# Qualitative RColorBrewer: type display.brewer.all(type="qual"). For qualitative palettes, the lowest
# number of distinct values available always is 3, but the largest number is different for different palettes.
# It is given together with the palette names in the following table: Accent 8 Dark2 8 Paired 12 Pastel1 9
# Pastel2 8 Set1 9 Set2 8 Set3 12
Pastel1Palette <- brewer.pal(9, "Pastel1")
Pastel2Palette <- brewer.pal(8, "Pastel2")
#------------------------------------------------------------------------------#
# Deifinition of Palettes with number of color equal to: my.palette.nc
#------------------------------------------------------------------------------#
# Palette using rainbow palette
RainbowPalette <- colorRampPalette(rev(rainbow(300)[my.palette.rc]))(my.palette.nc)
RainbowPaletteV2 <- colorRampPalette((rainbow(300)[my.palette.rc]))(my.palette.nc)
RainbowPaletteV3 <- colorRampPalette(rev(rainbow(600)[my.palette.rc]))(my.palette.nc)
RainbowPaletteV4 <- colorRampPalette((rainbow(600)[my.palette.rc]))(my.palette.nc)
RainbowPaletteV5 <- colorRampPalette(rev(rainbow(800)[my.palette.rc]))(my.palette.nc)
RainbowPaletteV6 <- colorRampPalette((rainbow(800)[my.palette.rc]))(my.palette.nc)
# Red Blue Palette
RedBluePalette <- colorRampPalette(c("red", "white", "blue"))(my.palette.nc)
# Red Blue Palette with lab space
RedBlueLabPalette <- colorRampPalette(c("red", "white", "blue"), space = "Lab")(my.palette.nc)
# Blue Orange palette
BlueOrangePalette <- colorRampPalette(c("blue", "cyan", "green", "yellow", "orange", "red"))(my.palette.nc)
# Heat Color palette
HeatPalette <- rev( heat.colors(my.palette.nc, alpha = .75) )
# Terrain Color Palette
TerrainPalette <- rev( terrain.colors(2*my.palette.nc, alpha = .75) )
# Rainbow Green to Red Palette
GreenToRedPalette <- rev( rainbow(5*my.palette.nc, alpha = .55)[0: 400] )
# Rainbow Green to Red Palette version 2
GreenToRedPaletteV2 <- c( rainbow(my.palette.nc, start = 0, end = 0.4) )
# Topo Color Palette
TopoPalette <- rev( topo.colors(10*my.palette.nc, alpha = .50)[0:840] )
# Cm Color Palette
CmPalette <- cm.colors(5*my.palette.nc, alpha = 1)
# Matlab jetcolor palette
JetColorPalette <- colorRampPalette(jet.colors.palette)(my.palette.nc)
JetColorPalette <- colorRampPalette(jet.colors.palette)(my.palette.nc)
# Red Orange Blue Palette
RedOrangeBluePalette <- rev(colorRampPalette(c("red", "orange", "blue"), space = "Lab")(my.palette.nc))
# My Pastel Palette
MyPastelOrangeBluePalette <- (colorRampPalette(my.pastel.palette)(my.palette.nc))
# My Color Brewer Palettes
MyColorBrewerYlGnBuPalette <- colorRampPalette(YlGnBuPalette, interpolate = "spline")(my.palette.nc)
MyColorBrewerYlOrBrPalette <- colorRampPalette(YlOrBrPalette, interpolate = "spline")(my.palette.nc)
MyColorBrewerYlOrRdPalette <- colorRampPalette(YlOrRdPalette, interpolate = "spline")(my.palette.nc)
MyColorBrewerSpectralPalette <- rev(colorRampPalette(SpectralPalette, interpolate = "spline")(my.palette.nc))
MyColorBrewerSpectralPaletteV2 <- colorRampPalette(SpectralPalette, interpolate = "spline")(my.palette.nc)
MyColorBrewerRdYlGnPalette <- colorRampPalette(RdYlGnPalette, interpolate = "spline")(my.palette.nc)
MyColorBrewerRdYlBuPalette <- colorRampPalette(RdYlBuPalette, interpolate = "spline")(my.palette.nc)
MyColorBrewerPastel1Palette <- colorRampPalette(Pastel1Palette, interpolate = "spline")(my.palette.nc)
MyColorBrewerPastel2Palette <- colorRampPalette(Pastel2Palette, interpolate = "spline")(my.palette.nc)
#------------------------------------------------------------------------------#
# Harmonized palettes. For more combinations access: http://design-seeds.com/,
# www.colourlovers.com/browse, www.color-hex.com/color-palettes/,
# www.colorcombos.com
#------------------------------------------------------------------------------#
RedBlueRedPalette <- colorRampPalette(c("red", "blue", "darkred"), interpolate = "spline")(my.palette.nc)
DarkBlueToBlackPalette <- colorRampPalette(c("darkblue", "red", "orange", "black"), interpolate = "spline")
(my.palette.nc)
YellowToBlackPalette <- colorRampPalette(rev(c("#191919", "#DFE2DB", "#FFF056", "#FFFFFF")), interpolate =
"spline")(my.palette.nc)
GreenToOrangePalette <- colorRampPalette((c("#585858", "#118C4E", "#C1E1A6", "#FF9009")), interpolate = "spline")
(my.palette.nc)
OrangeToDarkGreyPalette <- colorRampPalette(rev(c("#404040", "#6DBDD6", "#B71427", "#FFE658")), interpolate =
"spline")(my.palette.nc)
GrayOrangeGreenPalette <- colorRampPalette(rev(c("#558C89", "#74AFAD", "#D9853B", "#ECECEA")), interpolate =
"spline")(my.palette.nc)
GreenLemonPalette <- colorRampPalette(rev(c("#005A31", "#A8CD1B", "#CBE32D", "#F3FAB6")), interpolate =
"spline")(my.palette.nc)
OrangeToCyanPalette <- colorRampPalette(rev(c("#A7DBD8", "#E0E4CC", "#F38630", "#FA6900")), interpolate =
"spline")(my.palette.nc)
BluePurpleWinePalette <- colorRampPalette(rev(c("#F7F5EB", "#EFD7D7", "#E6B8C2", "#B594B2", "#8470A1")),
interpolate = "spline")(my.palette.nc)
BrownCoffeePalette <- colorRampPalette(rev(c("#E2AA79", "#BE7554", "#9B5730", "#823A21", "#5E3B25")),
interpolate = "spline")(my.palette.nc)
WaterLightBluePalette <- colorRampPalette((c("#5DBCD2", "#D9E6F6", "#7288C4", "#CFCFE7", "#F2E0F0")), interpolate =
"spline")(my.palette.nc)
TerraCotaBluePalette <- colorRampPalette((c("#E96D63", "#7FCA9F", "#85C1F5", '#4A789C', '#FCFEFD')), interpolate =
"spline")(my.palette.nc)
LightOrangeBluePalette <- colorRampPalette((c("#f7ecb2", "#c4d67a", "#3cb074", '#43cfc3', '#aaf0cd')), interpolate =
"spline")(my.palette.nc)
SandBrownBluePalette <- colorRampPalette((c("#ebe7e2", "#e3dbcf", "#d9c3a1", '#968f81', '#67a7db', '#c1dbeb')),
interpolate = "spline")(my.palette.nc)
SummerSunsetPalette <- colorRampPalette(rev(c('#b4bede', '#bf9bc7', '#5c4a80', '#5e485a', '#ffb891', '#fff7bd')),
interpolate = "spline")(my.palette.nc)
GradientBluePalette <- colorRampPalette((c('#ddecf6', '#99c6e5', '#56a1d5', '#33607f', '#19303f')), interpolate =
"spline")(my.palette.nc)
SwirlingRainbowPalette <- colorRampPalette(rev(c('#dfe3e2', '#97e7e8', '#3e8fd1', '#21596e', '#f7aaa6', '#e9f065')),
interpolate = "spline")(my.palette.nc)
BlackberryHuePalette <- colorRampPalette((c('#f6fab9', '#e3b571', '#5e2a3d', '#452c44', '#a3629c', '#b096ab')),
interpolate = "spline")(my.palette.nc)
HangingBluesPalette <- colorRampPalette((c('#f1d5f5', '#f6a8f7', '#c469e0', '#8f53b0', '#613d87', '#8763bd')),
interpolate = "spline")(my.palette.nc)
AquaLightBluePalette <- colorRampPalette((c("#ebdbd9", "#7db3a8", "#3d839c", "#57a7b5", "#73c1c7", "#a9d2de")),
interpolate = "spline")(my.palette.nc)
DesertCactusPalette <- colorRampPalette(rev(c("#ede1c0", "#97bd8c", "#738a7c", "#695f6b", "#de9a88", "#f5ccb8")),
interpolate = "spline")(my.palette.nc)
BonFireHuesPalette <- colorRampPalette(rev(c("#f2e9d9", "#dbc6b2", "#99786d", "#61564f", "#e0774e", "#f5d4a1")),
interpolate = "spline")(my.palette.nc)
PeacockPlumePalette <- colorRampPalette((c("#f2eee9", "#b8a2a0", "#61393e", "#e35349", "#91aacc", "#ededbe")),
interpolate = "spline")(my.palette.nc)
CrystalAquaPalette <- colorRampPalette(rev(c("#96ccd9", "#9cd1d6", "#ace0d8", "#c8d9d6", "#e6ddd6", "#ebebe4")),
interpolate = "spline")(my.palette.nc)
#------------------------------------------------------------------------------#
# Setting the current palette
#------------------------------------------------------------------------------#
ColorPalette.MyChosenPalette <- MyPastelOrangeBluePalette
The End.
Michel Alves dos Santos
Color Palettes in R
The surface used for display of the examples
is the representation of high-pass Gaussian
filter in the frequency domain.

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Mantel Haenszel methods in epidemiology (Stratification)
Mantel Haenszel methods in epidemiology (Stratification) Mantel Haenszel methods in epidemiology (Stratification)
Mantel Haenszel methods in epidemiology (Stratification)
 
Central tendency
Central tendencyCentral tendency
Central tendency
 
Single linear regression
Single linear regressionSingle linear regression
Single linear regression
 
Sensitivity, specificity and likelihood ratios
Sensitivity, specificity and likelihood ratiosSensitivity, specificity and likelihood ratios
Sensitivity, specificity and likelihood ratios
 
Torturing numbers - Descriptive Statistics for Growers (2013)
Torturing numbers - Descriptive Statistics for Growers (2013)Torturing numbers - Descriptive Statistics for Growers (2013)
Torturing numbers - Descriptive Statistics for Growers (2013)
 
Measures of fertility
Measures of fertilityMeasures of fertility
Measures of fertility
 
Biostatistics exam questions by tadele girum
Biostatistics exam questions  by tadele girumBiostatistics exam questions  by tadele girum
Biostatistics exam questions by tadele girum
 
Case control studies
Case control studiesCase control studies
Case control studies
 
Kwoledge of calculation of mean,median and mode
Kwoledge of calculation of mean,median and modeKwoledge of calculation of mean,median and mode
Kwoledge of calculation of mean,median and mode
 
Normal curve in Biostatistics data inference and applications
Normal curve in Biostatistics data inference and applicationsNormal curve in Biostatistics data inference and applications
Normal curve in Biostatistics data inference and applications
 
2 measure of central tendency
2 measure of central  tendency2 measure of central  tendency
2 measure of central tendency
 
Multiple Choice Questions - Biostatistics
Multiple Choice Questions - BiostatisticsMultiple Choice Questions - Biostatistics
Multiple Choice Questions - Biostatistics
 
Measures Of Association
Measures Of AssociationMeasures Of Association
Measures Of Association
 
Survival analysis
Survival analysisSurvival analysis
Survival analysis
 
Predictive value and likelihood ratio
Predictive value and likelihood ratio Predictive value and likelihood ratio
Predictive value and likelihood ratio
 
Roc
RocRoc
Roc
 
Chi-square, Yates, Fisher & McNemar
Chi-square, Yates, Fisher & McNemarChi-square, Yates, Fisher & McNemar
Chi-square, Yates, Fisher & McNemar
 
CART: Not only Classification and Regression Trees
CART: Not only Classification and Regression TreesCART: Not only Classification and Regression Trees
CART: Not only Classification and Regression Trees
 
Standardization of rates by Dr. Basil Tumaini
Standardization of rates by Dr. Basil TumainiStandardization of rates by Dr. Basil Tumaini
Standardization of rates by Dr. Basil Tumaini
 
Practice Test Chapter 6 (Normal Probability Distributions)
Practice Test Chapter 6 (Normal Probability Distributions)Practice Test Chapter 6 (Normal Probability Distributions)
Practice Test Chapter 6 (Normal Probability Distributions)
 

Similar a Color Palettes in R

Oracle forms 10 j – dynamic color customization 2udfoh community paper-colo...
Oracle forms 10 j – dynamic color customization  2udfoh  community paper-colo...Oracle forms 10 j – dynamic color customization  2udfoh  community paper-colo...
Oracle forms 10 j – dynamic color customization 2udfoh community paper-colo...
FITSFSd
 
you need to complete the r code and a singlepage document c.pdf
you need to complete the r code and a singlepage document c.pdfyou need to complete the r code and a singlepage document c.pdf
you need to complete the r code and a singlepage document c.pdf
adnankhan605720
 
R57php 1231677414471772-2
R57php 1231677414471772-2R57php 1231677414471772-2
R57php 1231677414471772-2
ady36
 

Similar a Color Palettes in R (13)

Easy HTML Tables in RStudio with Tabyl and kableExtra
Easy HTML Tables in RStudio with Tabyl and kableExtraEasy HTML Tables in RStudio with Tabyl and kableExtra
Easy HTML Tables in RStudio with Tabyl and kableExtra
 
Oracle forms 10 j – dynamic color customization 2udfoh community paper-colo...
Oracle forms 10 j – dynamic color customization  2udfoh  community paper-colo...Oracle forms 10 j – dynamic color customization  2udfoh  community paper-colo...
Oracle forms 10 j – dynamic color customization 2udfoh community paper-colo...
 
FCIP SASS Talk
FCIP SASS TalkFCIP SASS Talk
FCIP SASS Talk
 
Story Telling With Open Data
Story Telling With Open DataStory Telling With Open Data
Story Telling With Open Data
 
you need to complete the r code and a singlepage document c.pdf
you need to complete the r code and a singlepage document c.pdfyou need to complete the r code and a singlepage document c.pdf
you need to complete the r code and a singlepage document c.pdf
 
ERPsimulate_script
ERPsimulate_scriptERPsimulate_script
ERPsimulate_script
 
R57php 1231677414471772-2
R57php 1231677414471772-2R57php 1231677414471772-2
R57php 1231677414471772-2
 
Helvetia
HelvetiaHelvetia
Helvetia
 
Al Fazl International Weekly26 June 2015
Al Fazl International  Weekly26 June 2015Al Fazl International  Weekly26 June 2015
Al Fazl International Weekly26 June 2015
 
Mona cheatsheet
Mona cheatsheetMona cheatsheet
Mona cheatsheet
 
Wells Fargo Outline
Wells Fargo Outline Wells Fargo Outline
Wells Fargo Outline
 
Finding the sassy in sass
Finding the sassy in sassFinding the sassy in sass
Finding the sassy in sass
 
Refsim (R program)
Refsim (R program)Refsim (R program)
Refsim (R program)
 

Más de Michel Alves

Más de Michel Alves (20)

Texture Synthesis: An Approach Based on GPU Use
Texture Synthesis: An Approach Based on GPU UseTexture Synthesis: An Approach Based on GPU Use
Texture Synthesis: An Approach Based on GPU Use
 
Intelligent Transfer of Thematic Harmonic Color Palettes
Intelligent Transfer of Thematic Harmonic Color PalettesIntelligent Transfer of Thematic Harmonic Color Palettes
Intelligent Transfer of Thematic Harmonic Color Palettes
 
A Framework for Harmonic Color Measures
A Framework for Harmonic Color MeasuresA Framework for Harmonic Color Measures
A Framework for Harmonic Color Measures
 
Effectiveness of Image Quality Assessment Indexes
Effectiveness of Image Quality Assessment IndexesEffectiveness of Image Quality Assessment Indexes
Effectiveness of Image Quality Assessment Indexes
 
Introduction to Kernel Functions
Introduction to Kernel FunctionsIntroduction to Kernel Functions
Introduction to Kernel Functions
 
About Perception and Hue Histograms in HSV Space
About Perception and Hue Histograms in HSV SpaceAbout Perception and Hue Histograms in HSV Space
About Perception and Hue Histograms in HSV Space
 
Color Harmonization - Results
Color Harmonization - ResultsColor Harmonization - Results
Color Harmonization - Results
 
Wave Simulation Using Perlin Noise
Wave Simulation Using Perlin NoiseWave Simulation Using Perlin Noise
Wave Simulation Using Perlin Noise
 
Similarity Maps Using SSIM Index
Similarity Maps Using SSIM IndexSimilarity Maps Using SSIM Index
Similarity Maps Using SSIM Index
 
Qualifying Exam - Image-Based Reconstruction With Color Harmonization
Qualifying Exam - Image-Based Reconstruction With Color HarmonizationQualifying Exam - Image-Based Reconstruction With Color Harmonization
Qualifying Exam - Image-Based Reconstruction With Color Harmonization
 
TMS - Schedule of Presentations and Reports
TMS - Schedule of Presentations and ReportsTMS - Schedule of Presentations and Reports
TMS - Schedule of Presentations and Reports
 
Month Presentations Schedule - March/2015 - LCG/UFRJ
Month Presentations Schedule - March/2015 - LCG/UFRJMonth Presentations Schedule - March/2015 - LCG/UFRJ
Month Presentations Schedule - March/2015 - LCG/UFRJ
 
Sigmoid Curve Erf
Sigmoid Curve ErfSigmoid Curve Erf
Sigmoid Curve Erf
 
Hue Wheel Prototype
Hue Wheel PrototypeHue Wheel Prototype
Hue Wheel Prototype
 
Cosine Curve
Cosine CurveCosine Curve
Cosine Curve
 
Triangle Mesh Plot
Triangle Mesh PlotTriangle Mesh Plot
Triangle Mesh Plot
 
Triangle Plot
Triangle PlotTriangle Plot
Triangle Plot
 
Capacity-Constrained Point Distributions :: Video Slides
Capacity-Constrained Point Distributions :: Video SlidesCapacity-Constrained Point Distributions :: Video Slides
Capacity-Constrained Point Distributions :: Video Slides
 
Capacity-Constrained Point Distributions :: Density Function Catalog
Capacity-Constrained Point Distributions :: Density Function CatalogCapacity-Constrained Point Distributions :: Density Function Catalog
Capacity-Constrained Point Distributions :: Density Function Catalog
 
Capacity-Constrained Point Distributions :: Complementary Results
Capacity-Constrained Point Distributions :: Complementary ResultsCapacity-Constrained Point Distributions :: Complementary Results
Capacity-Constrained Point Distributions :: Complementary Results
 

Último

Último (20)

Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 

Color Palettes in R

  • 1. Color Palettes in R Author: Michel Alves dos Santos [[www.michelalves.com :: http://www.lcg.ufrj.br/Members/malves/ ]]
  • 2.
  • 3. #------------------------------------------------------------------------------# # Color Palettes. # Date : 20 February, 2012 # Author : Michel Alves dos Santos #------------------------------------------------------------------------------# #------------------------------------------------------------------------------# # Loading required libraries #------------------------------------------------------------------------------# require(RColorBrewer) #------------------------------------------------------------------------------# # Color Settings #------------------------------------------------------------------------------# my.palette.nc <- 255 # number of colors my.palette.rc <- 1:205 # range of colors #------------------------------------------------------------------------------- # Color Palettes - Definition of names and component colors #------------------------------------------------------------------------------- # Matlab falshy jet color jet.colors.palette <- c("#00007F", "blue", "#007FFF", "cyan", "#7FFF7F", "yellow", "#FF7F00", "red", "#7F0000") # Pastel palette my.pastel.palette <- rev(c("#62739F", "#8DABBD", "#AB9EB0", "#FFF0A7", "#F4BAA4")) # Sequential RColorBrewer: for more information type display.brewer.all() or display.brewer.all(type="seq") # The sequential palettes names are: Blues BuGn BuPu GnBu Greens Greys Oranges OrRd PuBu PuBuGn PuRd # Purples RdPu Reds YlGn YlGnBu YlOrBr YlOrRd. All the sequential palettes are available in variations from 3 # different values up to 9 different values. YlGnBuPalette <- brewer.pal(9, "YlGnBu") YlOrBrPalette <- brewer.pal(9, "YlOrBr") YlOrRdPalette <- brewer.pal(9, "YlOrRd") # Divergent RColorBrewer: type display.brewer.all(type="div"). The diverging palettes are: BrBG PiYG PRGn # PuOr RdBu RdGy RdYlBu RdYlGn Spectral. All the diverging palettes are available in variations from 3 # different values up to 11 different values. SpectralPalette <- brewer.pal(11, "Spectral") RdYlGnPalette <- brewer.pal(11, "RdYlGn") RdYlBuPalette <- brewer.pal(11, "RdYlBu") # Qualitative RColorBrewer: type display.brewer.all(type="qual"). For qualitative palettes, the lowest # number of distinct values available always is 3, but the largest number is different for different palettes. # It is given together with the palette names in the following table: Accent 8 Dark2 8 Paired 12 Pastel1 9 # Pastel2 8 Set1 9 Set2 8 Set3 12 Pastel1Palette <- brewer.pal(9, "Pastel1") Pastel2Palette <- brewer.pal(8, "Pastel2") #------------------------------------------------------------------------------# # Deifinition of Palettes with number of color equal to: my.palette.nc #------------------------------------------------------------------------------# # Palette using rainbow palette RainbowPalette <- colorRampPalette(rev(rainbow(300)[my.palette.rc]))(my.palette.nc) RainbowPaletteV2 <- colorRampPalette((rainbow(300)[my.palette.rc]))(my.palette.nc) RainbowPaletteV3 <- colorRampPalette(rev(rainbow(600)[my.palette.rc]))(my.palette.nc) RainbowPaletteV4 <- colorRampPalette((rainbow(600)[my.palette.rc]))(my.palette.nc) RainbowPaletteV5 <- colorRampPalette(rev(rainbow(800)[my.palette.rc]))(my.palette.nc) RainbowPaletteV6 <- colorRampPalette((rainbow(800)[my.palette.rc]))(my.palette.nc) # Red Blue Palette RedBluePalette <- colorRampPalette(c("red", "white", "blue"))(my.palette.nc) # Red Blue Palette with lab space RedBlueLabPalette <- colorRampPalette(c("red", "white", "blue"), space = "Lab")(my.palette.nc) # Blue Orange palette BlueOrangePalette <- colorRampPalette(c("blue", "cyan", "green", "yellow", "orange", "red"))(my.palette.nc) # Heat Color palette HeatPalette <- rev( heat.colors(my.palette.nc, alpha = .75) ) # Terrain Color Palette TerrainPalette <- rev( terrain.colors(2*my.palette.nc, alpha = .75) ) # Rainbow Green to Red Palette GreenToRedPalette <- rev( rainbow(5*my.palette.nc, alpha = .55)[0: 400] ) # Rainbow Green to Red Palette version 2 GreenToRedPaletteV2 <- c( rainbow(my.palette.nc, start = 0, end = 0.4) ) # Topo Color Palette TopoPalette <- rev( topo.colors(10*my.palette.nc, alpha = .50)[0:840] ) # Cm Color Palette CmPalette <- cm.colors(5*my.palette.nc, alpha = 1) # Matlab jetcolor palette JetColorPalette <- colorRampPalette(jet.colors.palette)(my.palette.nc)
  • 4. JetColorPalette <- colorRampPalette(jet.colors.palette)(my.palette.nc) # Red Orange Blue Palette RedOrangeBluePalette <- rev(colorRampPalette(c("red", "orange", "blue"), space = "Lab")(my.palette.nc)) # My Pastel Palette MyPastelOrangeBluePalette <- (colorRampPalette(my.pastel.palette)(my.palette.nc)) # My Color Brewer Palettes MyColorBrewerYlGnBuPalette <- colorRampPalette(YlGnBuPalette, interpolate = "spline")(my.palette.nc) MyColorBrewerYlOrBrPalette <- colorRampPalette(YlOrBrPalette, interpolate = "spline")(my.palette.nc) MyColorBrewerYlOrRdPalette <- colorRampPalette(YlOrRdPalette, interpolate = "spline")(my.palette.nc) MyColorBrewerSpectralPalette <- rev(colorRampPalette(SpectralPalette, interpolate = "spline")(my.palette.nc)) MyColorBrewerSpectralPaletteV2 <- colorRampPalette(SpectralPalette, interpolate = "spline")(my.palette.nc) MyColorBrewerRdYlGnPalette <- colorRampPalette(RdYlGnPalette, interpolate = "spline")(my.palette.nc) MyColorBrewerRdYlBuPalette <- colorRampPalette(RdYlBuPalette, interpolate = "spline")(my.palette.nc) MyColorBrewerPastel1Palette <- colorRampPalette(Pastel1Palette, interpolate = "spline")(my.palette.nc) MyColorBrewerPastel2Palette <- colorRampPalette(Pastel2Palette, interpolate = "spline")(my.palette.nc) #------------------------------------------------------------------------------# # Harmonized palettes. For more combinations access: http://design-seeds.com/, # www.colourlovers.com/browse, www.color-hex.com/color-palettes/, # www.colorcombos.com #------------------------------------------------------------------------------# RedBlueRedPalette <- colorRampPalette(c("red", "blue", "darkred"), interpolate = "spline")(my.palette.nc) DarkBlueToBlackPalette <- colorRampPalette(c("darkblue", "red", "orange", "black"), interpolate = "spline") (my.palette.nc) YellowToBlackPalette <- colorRampPalette(rev(c("#191919", "#DFE2DB", "#FFF056", "#FFFFFF")), interpolate = "spline")(my.palette.nc) GreenToOrangePalette <- colorRampPalette((c("#585858", "#118C4E", "#C1E1A6", "#FF9009")), interpolate = "spline") (my.palette.nc) OrangeToDarkGreyPalette <- colorRampPalette(rev(c("#404040", "#6DBDD6", "#B71427", "#FFE658")), interpolate = "spline")(my.palette.nc) GrayOrangeGreenPalette <- colorRampPalette(rev(c("#558C89", "#74AFAD", "#D9853B", "#ECECEA")), interpolate = "spline")(my.palette.nc) GreenLemonPalette <- colorRampPalette(rev(c("#005A31", "#A8CD1B", "#CBE32D", "#F3FAB6")), interpolate = "spline")(my.palette.nc) OrangeToCyanPalette <- colorRampPalette(rev(c("#A7DBD8", "#E0E4CC", "#F38630", "#FA6900")), interpolate = "spline")(my.palette.nc) BluePurpleWinePalette <- colorRampPalette(rev(c("#F7F5EB", "#EFD7D7", "#E6B8C2", "#B594B2", "#8470A1")), interpolate = "spline")(my.palette.nc) BrownCoffeePalette <- colorRampPalette(rev(c("#E2AA79", "#BE7554", "#9B5730", "#823A21", "#5E3B25")), interpolate = "spline")(my.palette.nc) WaterLightBluePalette <- colorRampPalette((c("#5DBCD2", "#D9E6F6", "#7288C4", "#CFCFE7", "#F2E0F0")), interpolate = "spline")(my.palette.nc) TerraCotaBluePalette <- colorRampPalette((c("#E96D63", "#7FCA9F", "#85C1F5", '#4A789C', '#FCFEFD')), interpolate = "spline")(my.palette.nc) LightOrangeBluePalette <- colorRampPalette((c("#f7ecb2", "#c4d67a", "#3cb074", '#43cfc3', '#aaf0cd')), interpolate = "spline")(my.palette.nc) SandBrownBluePalette <- colorRampPalette((c("#ebe7e2", "#e3dbcf", "#d9c3a1", '#968f81', '#67a7db', '#c1dbeb')), interpolate = "spline")(my.palette.nc) SummerSunsetPalette <- colorRampPalette(rev(c('#b4bede', '#bf9bc7', '#5c4a80', '#5e485a', '#ffb891', '#fff7bd')), interpolate = "spline")(my.palette.nc) GradientBluePalette <- colorRampPalette((c('#ddecf6', '#99c6e5', '#56a1d5', '#33607f', '#19303f')), interpolate = "spline")(my.palette.nc) SwirlingRainbowPalette <- colorRampPalette(rev(c('#dfe3e2', '#97e7e8', '#3e8fd1', '#21596e', '#f7aaa6', '#e9f065')), interpolate = "spline")(my.palette.nc) BlackberryHuePalette <- colorRampPalette((c('#f6fab9', '#e3b571', '#5e2a3d', '#452c44', '#a3629c', '#b096ab')), interpolate = "spline")(my.palette.nc) HangingBluesPalette <- colorRampPalette((c('#f1d5f5', '#f6a8f7', '#c469e0', '#8f53b0', '#613d87', '#8763bd')), interpolate = "spline")(my.palette.nc) AquaLightBluePalette <- colorRampPalette((c("#ebdbd9", "#7db3a8", "#3d839c", "#57a7b5", "#73c1c7", "#a9d2de")), interpolate = "spline")(my.palette.nc) DesertCactusPalette <- colorRampPalette(rev(c("#ede1c0", "#97bd8c", "#738a7c", "#695f6b", "#de9a88", "#f5ccb8")), interpolate = "spline")(my.palette.nc) BonFireHuesPalette <- colorRampPalette(rev(c("#f2e9d9", "#dbc6b2", "#99786d", "#61564f", "#e0774e", "#f5d4a1")), interpolate = "spline")(my.palette.nc) PeacockPlumePalette <- colorRampPalette((c("#f2eee9", "#b8a2a0", "#61393e", "#e35349", "#91aacc", "#ededbe")), interpolate = "spline")(my.palette.nc) CrystalAquaPalette <- colorRampPalette(rev(c("#96ccd9", "#9cd1d6", "#ace0d8", "#c8d9d6", "#e6ddd6", "#ebebe4")), interpolate = "spline")(my.palette.nc) #------------------------------------------------------------------------------# # Setting the current palette #------------------------------------------------------------------------------# ColorPalette.MyChosenPalette <- MyPastelOrangeBluePalette
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65.
  • 66.
  • 67.
  • 68.
  • 69.
  • 70.
  • 71.
  • 72.
  • 73.
  • 74.
  • 75.
  • 76.
  • 77.
  • 78.
  • 79.
  • 80.
  • 81.
  • 82.
  • 83.
  • 84.
  • 85.
  • 86.
  • 87.
  • 88.
  • 89.
  • 90.
  • 91.
  • 92.
  • 93.
  • 94.
  • 95.
  • 96.
  • 97.
  • 98.
  • 99.
  • 100.
  • 101.
  • 102.
  • 103.
  • 104.
  • 105. The End. Michel Alves dos Santos Color Palettes in R The surface used for display of the examples is the representation of high-pass Gaussian filter in the frequency domain.