Learn R Programming

g2r (version 0.1.0)

gauge_color: Gauge colour

Description

Gauge colour, similar to the scale_colour_* family of functions from the ggplot2 package.

Usage

gauge_color(g2, colors = NULL, callback = NULL)

gauge_color_viridis(g2, option = c("viridis", "magma", "plasma", "inferno", "cividis"), reverse = FALSE, callback = NULL)

Arguments

g2

An object of class g2r as returned by g2r.

colors

A vector of colors.

callback

A JavaScript callback function (see cb) which returns a color.

option

Palette name.

reverse

Whether to reverse the palette.

Examples

Run this code
# NOT RUN {
g2(mtcars, asp(mpg, qsec, color = drat)) %>% 
  fig_point() %>% 
  gauge_color(c("red", "white", "blue"))

# }

Run the code above in your browser using DataLab