设置报告、期刊或演示图的主题

函数索引 / 视觉设计与诊断
theme_forma()
统一标题、字体、面板、网格及图例的外观,为普通 ggplot2 图和 ggforma 图提供一致的视觉设计。
怎么用
用 preset 选择用途,mode 选择浅色或深色,base_size 和 base_family 设置文字。可分别调整网格、面板边框及图例位置。
返回结果
返回完整的 ggplot2 主题,可在其后用 theme() 覆盖个别元素。
调用方式
theme_forma(
base_size = 12,
base_family = "sans",
mode = c("light", "dark"),
panel = c("open", "framed"),
grid = c("both", "x", "y", "none"),
legend_position = "bottom",
text_engine = c("native", "shaped"),
lang = NULL,
preset = c("report", "journal", "editorial", "presentation", "dashboard")
)参数
base_size、base_family、mode、panel、grid、legend_position、text_engine、lang、preset
R 示例
ggplot2::ggplot(mtcars, ggplot2::aes(wt, mpg)) +
ggplot2::geom_point() + theme_forma(grid = "y")