find_cpt: Function to return colour palettes names

View source: R/find_cpt.R

find_cptR Documentation

Function to return colour palettes names

Description

find_cpt returns the name of the colour gradient that satisfy the search. It is a searcher. It is a mini mini mini google.

Usage

find_cpt(name)

Arguments

name

character; Word to be searched among the names of the cpt gradients.

Value

names that satisfy the search.

Note

This functions runs grep.

Examples

{
library(cptcity)
find_cpt("temperature")
image(matrix(1:100), col = cpt("idv_temperature"))
## Not run: 
library(cptcity)
# Do not run
# data names_cpt lazy loaded, already in environment
library(ggplot2)
ggplot(faithfuld, aes(waiting, eruptions)) +
geom_raster(aes(fill = density))

find_cpt("radar")
ggplot(faithfuld, aes(waiting, eruptions)) +
geom_raster(aes(fill = density)) +
scale_fill_gradientn(colours = cpt(n = 10, "ncl_radar"))

find_cpt("rain")
ggplot(faithfuld, aes(waiting, eruptions)) +
geom_raster(aes(fill = density)) +
scale_fill_gradientn(colours = cpt(pal = "pj_1_a_rainbow"))

## End(Not run)
}

ibarraespinosa/cptcity documentation built on Aug. 23, 2023, 4:41 a.m.