plotly_layout | R Documentation |
Applies common layout configuration to a Plotly chart.
plotly_layout(
p,
font = list(color = pal::pkg_config_val("plot_color_body"), family =
pal::pkg_config_val("font_family_body")),
paper_bgcolor = pal::pkg_config_val("plot_color_bg"),
plot_bgcolor = paper_bgcolor,
xaxis = list(gridcolor = pal::pkg_config_val("plot_color_grid")),
yaxis = list(gridcolor = pal::pkg_config_val("plot_color_grid")),
...
)
p |
Plotly object to modify. |
font |
Global font. Fonts used in traces and other layout components inherit from the global font. |
paper_bgcolor |
Background color of the paper where the graph is drawn. |
plot_bgcolor |
Background color of the plotting area in-between x and y axes. |
xaxis |
|
yaxis |
|
... |
Further layout configuration arguments. |
A plotly object.
Other plot theming functions:
ggplot2_geom_defaults()
,
ggplot2_theme()
,
ggplot2_theme_html()
plotly::plot_ly(data = mtcars,
type = "bar",
x = ~mpg) |>
salim::plotly_layout(font = list(color = pal::pkg_config_val(key = "plot_color_body",
pkg = "salim")))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.