council_layout: Council plotly formatting

View source: R/council_layout.R

council_layoutR Documentation

Council plotly formatting

Description

Council plotly formatting

Usage

council_layout(
  a_plotly,
  main_title = "",
  subtitle = "",
  x_title = "",
  y_title = "",
  legend_title = "",
  ...
)

plotly_layout(
  a_plotly,
  main_title = "",
  subtitle = "",
  x_title = "",
  y_title = "",
  legend_title = "",
  ...
)

Arguments

a_plotly

plotly::plot_ly() object

main_title

character, plot title

subtitle

character, plot subtitle

x_title

character, x-axis title

y_title

character y-axis title

legend_title

character, legend title

...

additional parameters passed to plotly::layout()

Value

plotly::plot_ly() object with Council styling

Note

Further examples in vignette("Color").

The subtitle returned is an annotation, and so cannot be further modified. If you want to modify the subtitle aesthetics, leave subtitle = "" and add a subtitle using plotly::layout(annotations = list(...)).

See Also

Other aesthetics: blue_cascade, colors, council.pal(), council_pal2(), map_council_continuous(), scale_color_council(), scale_fill_council(), theme_council()

Examples

## Not run: 

library(plotly)
library(councilR)

plotly::plot_ly(
  type = "scatter",
  mode = "markers",
  data = iris,
  x = ~Sepal.Length,
  y = ~Sepal.Width,
  color = ~Species,
  hoverinfo = "text",
  hovertext = ~ paste0(
    Species, "<br>",
    "Sepal Length: ", Sepal.Length, "<br>",
    "Sepal Width: ", Sepal.Width
  ),
  marker = list(
    size = 10,
    opacity = 0.8
  )
) %>%
  plotly_layout(
    main_title = "Iris",
    subtitle = "Sepal characteristics",
    x_title = "Sepal Length",
    y_title = "Sepal Width",
    legend_title = "Species",
    legend = list(orientation = "h")
  )

## End(Not run)

Metropolitan-Council/councilR documentation built on March 30, 2024, 2:43 a.m.