Set palettes for various plot attributes
set_palette(
fig,
discrete_color = NULL,
discrete_alpha = NULL,
continuous_color = NULL,
continuous_alpha = NULL,
discrete_glyph = NULL,
discrete_fill_color = NULL,
discrete_line_color = NULL,
discrete_text_color = NULL,
discrete_fill_alpha = NULL,
discrete_line_alpha = NULL,
discrete_text_alpha = NULL,
discrete_line_dash = NULL,
discrete_line_width = NULL,
discrete_size = NULL,
continuous_glyph = NULL,
continuous_fill_color = NULL,
continuous_line_color = NULL,
continuous_text_color = NULL,
continuous_fill_alpha = NULL,
continuous_line_alpha = NULL,
continuous_text_alpha = NULL,
continuous_line_dash = NULL,
continuous_line_width = NULL,
continuous_size = NULL
)
figure to update theme palettes for
a discrete color palette to override the theme (see details)
a discrete alpha palette to override the theme (see details)
a continuous color palette to override the theme (see details)
a continuous alpha palette to override the theme (see details)
a discrete glyph palette to override the theme
a discrete fill_color palette to override the theme
a discrete line_color palette to override the theme
a discrete text_color palette to override the theme
a discrete fill_alpha palette to override the theme
a discrete line_alpha palette to override the theme
a discrete text_alpha palette to override the theme
a discrete line_dash palette to override the theme
a discrete line_width palette to override the theme
a discrete size palette to override the theme
a continuous glyph palette to override the theme
a continuous fill_color palette to override the theme
a continuous line_color palette to override the theme
a continuous text_color palette to override the theme
a continuous fill_alpha palette to override the theme
a continuous line_alpha palette to override the theme
a continuous text_alpha palette to override the theme
a continuous line_dash palette to override the theme
a continuous line_width palette to override the theme
a continuous size palette to override the theme
Palettes specified in this function will override the existing theme and apply the specified attributes when they are not otherwise explicitly specified in a layer function. See the contents of bk_default_theme
for an example of the theme elements this will update. As a convenience, if you use discrete_color
, the palette will apply to all the discrete_***_color
attributes unless those are explicitly specified also. The same pattern is true for discrete_alpha
, continuous_color
, and continuous_alpha
. For specifying discrete color palettes, the easiest thing to do is use pal_color
with a vector of colors you want to use in the palette.
# NOT RUN {
figure() %>%
ly_points(Sepal.Length, Sepal.Width, data = iris,
color = Species, glyph = Species) %>%
set_palette(discrete_color = pal_color(c("red", "blue", "green")))
# }
Run the code above in your browser using DataLab