This function return a collor palette based on the name or position of the palette.
cpt(
pal = "mpl_inferno",
n = 100,
colorRampPalette = FALSE,
rev = FALSE,
frgb = rep(1, 3)
)
Palette of colors available or the number of the position
integer; number of colors
Logical; to be used in sf and mapview.
Logical; to internally revert order of rgb color vectors.
Numeric; vector of 3 to change internal rgb composition. The order is red, green, blue
A colour palette function.
The cpt-city web archive comes from: http://soliton.vm.bytemark.co.uk/pub/cpt-city/index.html
{
library(cptcity)
image(matrix(1:100), col = cpt(pal = "mpl_inferno"))
find_cpt("temperature")
image(matrix(1:100), col = cpt("idv_temperature"))
image(matrix(1:100), col = cpt("idv_temperature", rev = TRUE))
if (FALSE) {
# Do not run
library(ggplot2)
ggplot(faithfuld, aes(waiting, eruptions)) +
geom_raster(aes(fill = density))
ggplot(faithfuld, aes(waiting, eruptions)) +
geom_raster(aes(fill = density)) +
scale_fill_gradientn(colours = cpt(n = 100))
}
}