Skip to content

Commit

Permalink
docs: ggplot2 color defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
niekdt committed Sep 5, 2024
1 parent 6437ce8 commit 7be0982
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/actionsheets/data/R/plot/ggplot2.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,29 @@ description = "For themes, see https://ggplot2-book.org/themes#sec-themes"
action = "Set default theme"
code = "theme_set(theme_minimal())"

[theme.set.default.color.viridis]
action = "Set viridis as default color"
code = """
options(
ggplot2.discrete.colour = 'viridis',
ggplot2.discrete.fill = 'viridis',
ggplot2.continuous.colour = 'viridis',
ggplot2.continuous.fill = 'viridis'
)
"""

[theme.set.default.color.viridis.option]
action = "Set viridis option as default color"
code = """
options(
ggplot2.discrete.colour = function(...) scale_color_viridis_d(..., option = 'turbo'),
ggplot2.discrete.fill = function(...) scale_fill_viridis_d(..., option = 'turbo'),
ggplot2.continuous.colour = function(...) scale_color_viridis_c(..., option = 'turbo'),
ggplot2.continuous.fill = function(...) scale_fill_viridis_c(..., option = 'turbo')
)
"""



[plot]
section = "Plots"
Expand Down

0 comments on commit 7be0982

Please sign in to comment.