Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

pal.cube

Show one palette/colormap in three dimensional RGB or LUV space


Description

The palette is converted to RGB or LUV coordinates and plotted in a three-dimensional scatterplot. The LUV space is probably better, but it is easier to tweak colors by hand in RGB space.

Usage

pal.cube(pal, n = 100, label = FALSE, type = "RGB")

Arguments

pal

A palette/colormap function or a vector of colors.

n

The number of colors to display for palette functions.

label

If TRUE, show color name/value on plot

type

Either "RGB" (default) or "LUV".

Details

What to look for:

A good palette has colors that are spread somewhat uniformly in 3D.

Value

None

References

None

Examples

## Not run: 
pal.cube(cubehelix)
pal.cube(glasbey, n=32) # RGB, blues are too close to each other
pal.cube(glasbey, n=32, type="LUV")
pal.cube(cols25(25), type="LUV", label=TRUE)
# To open a second cube
rgl.open() # Open a new RGL device
rgl.bg(color = "white") # Setup the background color
pal.cube(colors()[c(1:152, 254:260, 362:657)]) # All R non-grey colors

## End(Not run)

pals

Color Palettes, Colormaps, and Tools to Evaluate Them

v1.7
GPL-3
Authors
Kevin Wright [aut, cre] (<https://orcid.org/0000-0002-0617-8673>)
Initial release
2021-04-16

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.