This function provides a convenient way to apply Microsoft themed color scales and aesthetics to ggplot2 plots. The user can specify whether they want a continuous or discrete theme by providing the `scale_type` argument.
theme_samy(
scale_type = c("discrete", "continuous"),
index = NULL,
direction = 1,
guide = "legend",
fallback_font = "sans"
)
A character string specifying the type of scale, either "continuous" or "discrete". Default is "discrete".
An optional numeric index or vector of indices to select specific colors from the SAMY color palette.
An optional numeric value (1 or -1) specifying the direction of the color gradient for continuous scales. Default is 1.
An optional character string specifying the type of guide to use for continuous scales. Default is 'legend'.
Adds a fallback font of 'sans' in case user does not have required font.
A list containing the ggplot2 theme, fill scale, and color scale.
if (FALSE) {
library(ggplot2)
# Example with continuous theme
ggplot(mtcars, aes(x = wt, y = mpg, color = qsec)) +
geom_point() +
theme_samy(scale_type = "continuous")
# Example with discrete theme
ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, color = Species)) +
geom_point() +
theme_samy(scale_type = "discrete")
}