Description Usage Arguments Details Value Examples
This function return a collor palette based on the name or position of the palette.
1 2 3 4 5 6 7 |
pal |
Palette of colors available or the number of the position |
n |
integer; number of colors |
colorRampPalette |
Logical; to be used in sf and mapview. |
rev |
Logical; to internally revert order of rgb color vectors. |
frgb |
Numeric; vector of 3 to change internal rgb composition. The order is red, green, blue |
The cpt-city web archive comes from: http://soliton.vm.bytemark.co.uk/pub/cpt-city/index.html
A colour palette function.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | {
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))
# now you can select more than one palette!!!
image(matrix(1:100),
col = cpt(pal = c("idv_temperature",
"arendal_temperature"),
rev = TRUE))
## Not run:
# 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))
## End(Not run)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.