Tuesday 29 August 2017

R Color Demo

Cited from Colors in R

colors <- RColorBrewer::brewer.pal(NumOfColor, ColorPaletteName)

"colorRampPalette" can be called to interpolate these colors, and it actually returns a function.

pal <- colorRampPalette(colors)

pal is a function that takes a positive integer argument and returns that number of colors from the palette.

pal(NumOfColor)

for example, pal(10)

No comments:

Post a Comment