😎 Give your xaringan slides some style
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

78 lines
3.2KB

  1. % Generated by roxygen2: do not edit by hand
  2. % Please edit documentation in R/ggplot2.R
  3. \name{theme_xaringan}
  4. \alias{theme_xaringan}
  5. \title{A Plot Theme for ggplot2 by xaringanthemer}
  6. \usage{
  7. theme_xaringan(text_color = NULL, background_color = NULL,
  8. accent_color = NULL, accent_secondary_color = NULL, ...)
  9. }
  10. \arguments{
  11. \item{text_color}{Color for text and foreground, inherits from \code{text_color}}
  12. \item{background_color}{Color for background, inherits from
  13. \code{background_color}}
  14. \item{accent_color}{Color for titles and accents, inherits from
  15. \code{header_color}}
  16. \item{accent_secondary_color}{Color for secondary accents, inherits from
  17. \code{text_bold_color}}
  18. \item{...}{Arguments passed on to \code{theme_xaringan_base}
  19. \describe{
  20. \item{text_color}{Color for text and foreground}
  21. \item{background_color}{Color for background}
  22. \item{accent_color}{Color for titles and accents, inherits from
  23. \code{header_color} or \code{text_color}. Used for the \code{title} base setting in
  24. \code{\link[ggplot2:theme]{ggplot2::theme()}}, and additionally for setting the \code{color} or \code{fill} of
  25. \link{ggplot2} geom defaults.}
  26. \item{accent_secondary_color}{Color for secondary accents, inherits from
  27. \code{text_bold_color} or \code{accent_color}. Used only when setting \link{ggplot2} geom
  28. defaults.}
  29. \item{set_ggplot_defaults}{Should defaults be set for \link{ggplot2} \emph{geoms}?
  30. Defaults to TRUE. To restore ggplot's defaults, or the previously set geom
  31. defaults, see \code{\link[=theme_xaringan_restore_defaults]{theme_xaringan_restore_defaults()}}.}
  32. \item{text_font}{Font to use for text elements, passed to
  33. \code{\link[sysfonts:font_add_google]{sysfonts::font_add_google()}}, if available and \code{text_font_use_google} is
  34. \code{TRUE}. Inherits from \code{text_font_family}.}
  35. \item{text_font_use_google}{Is \code{text_font} available on \href{https://fonts.google.com}{Google Fonts}?}
  36. \item{text_font_size}{Base text font size, inherits from \code{text_font_size}, or
  37. defaults to 11.}
  38. \item{title_font}{Font to use for title elements, passed to
  39. \code{\link[sysfonts:font_add_google]{sysfonts::font_add_google()}}, if available and \code{title_font_use_google} is
  40. \code{TRUE}. Inherits from \code{title_font_family}.}
  41. \item{title_font_use_google}{Is \code{title_font} available on \href{https://fonts.google.com}{Google Fonts}?}
  42. \item{title_font_size}{Base text font size, inherits from \code{title_font_size},
  43. or defaults to 14.}
  44. }}
  45. }
  46. \value{
  47. A ggplot2 theme
  48. }
  49. \description{
  50. \strong{Lifecycle:} \href{https://www.tidyverse.org/lifecycle/#experimental}{Experimental}.
  51. Creates \link{ggplot2} themes to match the xaringanthemer theme used in the
  52. \link{xaringan} slides that seamlessly matches the "normal" slide colors and
  53. styles.
  54. }
  55. \examples{
  56. if (requireNamespace("ggplot2", quietly = TRUE)) {
  57. # Set xaringanthemer theme but save to tempfile
  58. style_duo_accent(outfile = tempfile())
  59. library(ggplot2)
  60. ggplot(iris) +
  61. aes(Petal.Length, Petal.Width) +
  62. geom_point() +
  63. theme_xaringan()
  64. }
  65. }
  66. \seealso{
  67. Other xaringanthemer ggplot2 themes: \code{\link{theme_xaringan_base}},
  68. \code{\link{theme_xaringan_inverse}},
  69. \code{\link{theme_xaringan_set_defaults}}
  70. }
  71. \concept{xaringanthemer ggplot2 themes}