Bladeren bron

mark ggplot2 themes and functions as experimental

tags/v0.3.0
Garrick Aden-Buie 6 jaren geleden
bovenliggende
commit
699d107292
6 gewijzigde bestanden met toevoegingen van 58 en 16 verwijderingen
  1. +34
    -8
      R/ggplot2.R
  2. +2
    -0
      man/scale_xaringan.Rd
  3. +2
    -0
      man/theme_xaringan.Rd
  4. +16
    -8
      man/theme_xaringan_base.Rd
  5. +2
    -0
      man/theme_xaringan_inverse.Rd
  6. +2
    -0
      man/theme_xaringan_set_defaults.Rd

+ 34
- 8
R/ggplot2.R Bestand weergeven



#' A Plot Theme for ggplot2 by xaringanthemer #' A Plot Theme for ggplot2 by xaringanthemer
#' #'
#' @description
#'
#' **Lifecycle:** [Experimental](https://www.tidyverse.org/lifecycle/#experimental).
#'
#' Creates [ggplot2] themes to match the xaringanthemer theme used in the #' Creates [ggplot2] themes to match the xaringanthemer theme used in the
#' [xaringan] slides that seamlessly matches the "normal" slide colors and #' [xaringan] slides that seamlessly matches the "normal" slide colors and
#' styles. #' styles.


#' An Inverse Plot Theme for ggplot2 by xaringanthemer #' An Inverse Plot Theme for ggplot2 by xaringanthemer
#' #'
#' @description
#'
#' **Lifecycle:** [Experimental](https://www.tidyverse.org/lifecycle/#experimental).
#'
#' A [ggplot2] xaringanthemer plot theme to seamlessly match the "inverse" #' A [ggplot2] xaringanthemer plot theme to seamlessly match the "inverse"
#' [xaringan] slide colors and styles as styled by [xaringanthemer]. #' [xaringan] slide colors and styles as styled by [xaringanthemer].
#' #'


#' The ggplot2 xaringanthemer base plot theme #' The ggplot2 xaringanthemer base plot theme
#' #'
#' @description
#'
#' **Lifecycle:** [Experimental](https://www.tidyverse.org/lifecycle/#experimental).
#'
#' Provides a base plot theme for [ggplot2] to match the [xaringan] slide theme #' Provides a base plot theme for [ggplot2] to match the [xaringan] slide theme
#' created by [xaringanthemer]. The theme is designed to create a general plot #' created by [xaringanthemer]. The theme is designed to create a general plot
#' style from two colors, a `background_color` and a `text_color` (or foreground #' style from two colors, a `background_color` and a `text_color` (or foreground
#' text_color = "#e1e5f2", #' text_color = "#e1e5f2",
#' background_color = "#021c25", #' background_color = "#021c25",
#' accent_color = "#1f7a8c", #' accent_color = "#1f7a8c",
#' set_ggplot_defaults = TRUE) +
#' labs(title = "Basic Iris Plot",
#' subtitle = "+ theme_xaringan_base()",
#' caption = "{xaringanthemer}")
#' set_ggplot_defaults = TRUE
#' ) +
#' labs(
#' title = "Basic Iris Plot",
#' subtitle = "+ theme_xaringan_base()",
#' caption = "{xaringanthemer}"
#' )
#' #'
#' ggplot(iris) + #' ggplot(iris) +
#' aes(Petal.Length, Petal.Width) + #' aes(Petal.Length, Petal.Width) +
#' text_color = "#021c25", #' text_color = "#021c25",
#' background_color = "#e1e5f2", #' background_color = "#e1e5f2",
#' accent_color = "#1f7a8c", #' accent_color = "#1f7a8c",
#' set_ggplot_defaults = TRUE) +
#' labs(title = "Basic Iris Plot",
#' subtitle = "+ theme_xaringan_base()",
#' caption = "{xaringanthemer}")
#' set_ggplot_defaults = TRUE
#' ) +
#' labs(
#' title = "Basic Iris Plot",
#' subtitle = "+ theme_xaringan_base()",
#' caption = "{xaringanthemer}"
#' )
#' } #' }
#' #'
#' @return A ggplot2 theme #' @return A ggplot2 theme


#' Set and Restore ggplot2 geom Defaults #' Set and Restore ggplot2 geom Defaults
#' #'
#' @description
#'
#' **Lifecycle:** [Experimental](https://www.tidyverse.org/lifecycle/#experimental).
#'
#' Set [ggplot2] _geom_ defaults to match [theme_xaringan()] with #' Set [ggplot2] _geom_ defaults to match [theme_xaringan()] with
#' `theme_xaringan_set_defaults()` and restore the standard or previously-set #' `theme_xaringan_set_defaults()` and restore the standard or previously-set
#' defaults with `theme_xaringan_restore_defaults()`. By default, #' defaults with `theme_xaringan_restore_defaults()`. By default,


#' Xaringan Themer ggplot2 Scales #' Xaringan Themer ggplot2 Scales
#' #'
#' @description
#'
#' **Lifecycle:** [Experimental](https://www.tidyverse.org/lifecycle/#experimental).
#'
#' Color and fill single-color scales for discrete and continuous values, #' Color and fill single-color scales for discrete and continuous values,
#' created using the primary accent color of the xaringanthemer styles. #' created using the primary accent color of the xaringanthemer styles.
#' #'

+ 2
- 0
man/scale_xaringan.Rd Bestand weergeven

\code{\link[=ggplot2:discrete_scale]{ggplot2:discrete_scale()}}.} \code{\link[=ggplot2:discrete_scale]{ggplot2:discrete_scale()}}.}
} }
\description{ \description{
\strong{Lifecycle:} \href{https://www.tidyverse.org/lifecycle/#experimental}{Experimental}.

Color and fill single-color scales for discrete and continuous values, Color and fill single-color scales for discrete and continuous values,
created using the primary accent color of the xaringanthemer styles. created using the primary accent color of the xaringanthemer styles.
} }

+ 2
- 0
man/theme_xaringan.Rd Bestand weergeven

A ggplot2 theme A ggplot2 theme
} }
\description{ \description{
\strong{Lifecycle:} \href{https://www.tidyverse.org/lifecycle/#experimental}{Experimental}.

Creates \link{ggplot2} themes to match the xaringanthemer theme used in the Creates \link{ggplot2} themes to match the xaringanthemer theme used in the
\link{xaringan} slides that seamlessly matches the "normal" slide colors and \link{xaringan} slides that seamlessly matches the "normal" slide colors and
styles. styles.

+ 16
- 8
man/theme_xaringan_base.Rd Bestand weergeven

A ggplot2 theme A ggplot2 theme
} }
\description{ \description{
\strong{Lifecycle:} \href{https://www.tidyverse.org/lifecycle/#experimental}{Experimental}.

Provides a base plot theme for \link{ggplot2} to match the \link{xaringan} slide theme Provides a base plot theme for \link{ggplot2} to match the \link{xaringan} slide theme
created by \link{xaringanthemer}. The theme is designed to create a general plot created by \link{xaringanthemer}. The theme is designed to create a general plot
style from two colors, a \code{background_color} and a \code{text_color} (or foreground style from two colors, a \code{background_color} and a \code{text_color} (or foreground
text_color = "#e1e5f2", text_color = "#e1e5f2",
background_color = "#021c25", background_color = "#021c25",
accent_color = "#1f7a8c", accent_color = "#1f7a8c",
set_ggplot_defaults = TRUE) +
labs(title = "Basic Iris Plot",
subtitle = "+ theme_xaringan_base()",
caption = "{xaringanthemer}")
set_ggplot_defaults = TRUE
) +
labs(
title = "Basic Iris Plot",
subtitle = "+ theme_xaringan_base()",
caption = "{xaringanthemer}"
)


ggplot(iris) + ggplot(iris) +
aes(Petal.Length, Petal.Width) + aes(Petal.Length, Petal.Width) +
text_color = "#021c25", text_color = "#021c25",
background_color = "#e1e5f2", background_color = "#e1e5f2",
accent_color = "#1f7a8c", accent_color = "#1f7a8c",
set_ggplot_defaults = TRUE) +
labs(title = "Basic Iris Plot",
subtitle = "+ theme_xaringan_base()",
caption = "{xaringanthemer}")
set_ggplot_defaults = TRUE
) +
labs(
title = "Basic Iris Plot",
subtitle = "+ theme_xaringan_base()",
caption = "{xaringanthemer}"
)
} }


} }

+ 2
- 0
man/theme_xaringan_inverse.Rd Bestand weergeven

A ggplot2 theme A ggplot2 theme
} }
\description{ \description{
\strong{Lifecycle:} \href{https://www.tidyverse.org/lifecycle/#experimental}{Experimental}.

A \link{ggplot2} xaringanthemer plot theme to seamlessly match the "inverse" A \link{ggplot2} xaringanthemer plot theme to seamlessly match the "inverse"
\link{xaringan} slide colors and styles as styled by \link{xaringanthemer}. \link{xaringan} slide colors and styles as styled by \link{xaringanthemer}.
} }

+ 2
- 0
man/theme_xaringan_set_defaults.Rd Bestand weergeven

Invisibly returns a list of the current ggplot2 geom defaults Invisibly returns a list of the current ggplot2 geom defaults
} }
\description{ \description{
\strong{Lifecycle:} \href{https://www.tidyverse.org/lifecycle/#experimental}{Experimental}.

Set \link{ggplot2} \emph{geom} defaults to match \code{\link[=theme_xaringan]{theme_xaringan()}} with Set \link{ggplot2} \emph{geom} defaults to match \code{\link[=theme_xaringan]{theme_xaringan()}} with
\code{theme_xaringan_set_defaults()} and restore the standard or previously-set \code{theme_xaringan_set_defaults()} and restore the standard or previously-set
defaults with \code{theme_xaringan_restore_defaults()}. By default, defaults with \code{theme_xaringan_restore_defaults()}. By default,

Laden…
Annuleren
Opslaan