ggplot2_theme_html | R Documentation |
Dynamically adds common HTML-specific theming to a ggplot2 chart. It depends on the current knitr output format whether the additional HTML-specific theming is actually added or not.
ggplot2_theme_html(
.color_text = pal::pkg_config_val("plot_color_body"),
.color_bg = pal::pkg_config_val("plot_color_bg"),
.color_grid = pal::pkg_config_val("plot_color_grid"),
...
)
.color_text |
Text color to use for all text elements ( |
.color_bg |
Background color to use when the knitr output format is HTML. |
.color_grid |
Grid color to use when the knitr output format is HTML. |
... |
Further arguments passed on to |
Note that ggplot2_theme_html()
must be evaluated during knitting to work properly.
An object of class theme
.
Other plot theming functions:
ggplot2_geom_defaults()
,
ggplot2_theme()
,
plotly_layout()
sysfonts::font_add_google(name = "Alegreya Sans")
showtext::showtext_auto()
ggplot2::ggplot(data = mtcars,
mapping = ggplot2::aes(x = mpg,
y = cyl)) +
ggplot2::geom_point() +
salim::ggplot2_theme() +
salim::ggplot2_theme_html()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.