File: theme_default.Rd

package info (click to toggle)
r-cran-bayesplot 1.14.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,288 kB
  • sloc: sh: 13; makefile: 2
file content (53 lines) | stat: -rw-r--r-- 1,737 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/bayesplot-ggplot-themes.R
\name{theme_default}
\alias{theme_default}
\title{Default \strong{bayesplot} plotting theme}
\usage{
theme_default(
  base_size = getOption("bayesplot.base_size", 12),
  base_family = getOption("bayesplot.base_family", "serif")
)
}
\arguments{
\item{base_size, base_family}{Base font size and family (passed to
\code{\link[ggplot2:ggtheme]{ggplot2::theme_bw()}}). It is possible to set \code{"bayesplot.base_size"} and
\code{"bayesplot.base_family"} via \code{\link[=options]{options()}} to change the defaults, which are
\code{12} and \code{"serif"}, respectively.}
}
\value{
A ggplot \link[ggplot2:theme]{theme} object.
}
\description{
The \code{\link[=theme_default]{theme_default()}} function returns the default ggplot
\link[ggplot2:theme]{theme} used by the \strong{bayesplot} plotting functions. See
\code{\link[=bayesplot_theme_set]{bayesplot_theme_set()}} for details on setting and updating the plotting
theme.
}
\examples{
class(theme_default())

bayesplot_theme_set() # defaults to setting theme_default()
x <- example_mcmc_draws()
mcmc_hist(x)

# change the default font size and family for bayesplots
bayesplot_theme_set(theme_default(base_size = 8, base_family = "sans"))
mcmc_hist(x)
mcmc_areas(x, regex_pars = "beta")

# change back
bayesplot_theme_set()
mcmc_areas(x, regex_pars = "beta")

}
\seealso{
\code{\link[=bayesplot_theme_set]{bayesplot_theme_set()}} to change the ggplot theme.

\link{bayesplot-colors} to set or view the color scheme used
for plotting.

\link{bayesplot-helpers} for a variety of convenience functions,
many of which provide shortcuts for tweaking theme elements after creating
a plot.
}