SlideShare a Scribd company logo
1 of 105
Download to read offline
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.

More Related Content

Similar to Color Palettes in R

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 kableExtraBarry DeCicco
 
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.pdfadnankhan605720
 
R57php 1231677414471772-2
R57php 1231677414471772-2R57php 1231677414471772-2
R57php 1231677414471772-2ady36
 
Helvetia
HelvetiaHelvetia
HelvetiaESUG
 
Al Fazl International Weekly26 June 2015
Al Fazl International  Weekly26 June 2015Al Fazl International  Weekly26 June 2015
Al Fazl International Weekly26 June 2015muzaffertahir9
 
Finding the sassy in sass
Finding the sassy in sassFinding the sassy in sass
Finding the sassy in sassTudor Barbu
 

Similar to 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)
 

More from Michel Alves

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 UseMichel Alves
 
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 PalettesMichel Alves
 
A Framework for Harmonic Color Measures
A Framework for Harmonic Color MeasuresA Framework for Harmonic Color Measures
A Framework for Harmonic Color MeasuresMichel Alves
 
Effectiveness of Image Quality Assessment Indexes
Effectiveness of Image Quality Assessment IndexesEffectiveness of Image Quality Assessment Indexes
Effectiveness of Image Quality Assessment IndexesMichel Alves
 
Introduction to Kernel Functions
Introduction to Kernel FunctionsIntroduction to Kernel Functions
Introduction to Kernel FunctionsMichel Alves
 
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 SpaceMichel Alves
 
Color Harmonization - Results
Color Harmonization - ResultsColor Harmonization - Results
Color Harmonization - ResultsMichel Alves
 
Wave Simulation Using Perlin Noise
Wave Simulation Using Perlin NoiseWave Simulation Using Perlin Noise
Wave Simulation Using Perlin NoiseMichel Alves
 
Similarity Maps Using SSIM Index
Similarity Maps Using SSIM IndexSimilarity Maps Using SSIM Index
Similarity Maps Using SSIM IndexMichel Alves
 
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 HarmonizationMichel Alves
 
TMS - Schedule of Presentations and Reports
TMS - Schedule of Presentations and ReportsTMS - Schedule of Presentations and Reports
TMS - Schedule of Presentations and ReportsMichel Alves
 
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/UFRJMichel Alves
 
Hue Wheel Prototype
Hue Wheel PrototypeHue Wheel Prototype
Hue Wheel PrototypeMichel Alves
 
Triangle Mesh Plot
Triangle Mesh PlotTriangle Mesh Plot
Triangle Mesh PlotMichel Alves
 
Capacity-Constrained Point Distributions :: Video Slides
Capacity-Constrained Point Distributions :: Video SlidesCapacity-Constrained Point Distributions :: Video Slides
Capacity-Constrained Point Distributions :: Video SlidesMichel Alves
 
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 CatalogMichel Alves
 
Capacity-Constrained Point Distributions :: Complementary Results
Capacity-Constrained Point Distributions :: Complementary ResultsCapacity-Constrained Point Distributions :: Complementary Results
Capacity-Constrained Point Distributions :: Complementary ResultsMichel Alves
 

More from 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
 

Recently uploaded

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.pdfNirmal Dwivedi
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
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.MaryamAhmad92
 
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 17Celine George
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
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.pptxDenish Jangid
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
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Ữ Â...Nguyen Thanh Tu Collection
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the ClassroomPooky Knightsmith
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
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.pdfAdmir Softic
 

Recently uploaded (20)

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
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
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.
 
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
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
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
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
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Ữ Â...
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
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
 

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.