20.6 Scales

Example Build a wrapper for a new palette to an existing scale. This is done by providing a new palette scale into the relevant basic scale.

print(scale_fill_viridis_c)
function (name = waiver(), ..., alpha = 1, begin = 0, end = 1, 
    direction = 1, option = "D", values = NULL, space = "Lab", 
    na.value = "grey50", guide = "colourbar", aesthetics = "fill") 
{
    continuous_scale(aesthetics, name = name, palette = pal_gradient_n(pal_viridis(alpha, 
        begin, end, direction, option)(6), values, space), na.value = na.value, 
        guide = guide, ...)
}
<bytecode: 0x56267eec0120>
<environment: namespace:ggplot2>