File: theme_minimal_grid.Rd

package info (click to toggle)
r-cran-cowplot 1.1.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,564 kB
  • sloc: sh: 13; makefile: 5
file content (88 lines) | stat: -rw-r--r-- 2,389 bytes parent folder | download | duplicates (2)
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/themes.R
\name{theme_minimal_grid}
\alias{theme_minimal_grid}
\alias{theme_minimal_vgrid}
\alias{theme_minimal_hgrid}
\title{Minimalistic themes with grids}
\usage{
theme_minimal_grid(
  font_size = 14,
  font_family = "",
  line_size = 0.5,
  rel_small = 12/14,
  rel_tiny = 11/14,
  rel_large = 16/14,
  color = "grey85",
  colour
)

theme_minimal_vgrid(
  font_size = 14,
  font_family = "",
  line_size = 0.5,
  rel_small = 12/14,
  rel_tiny = 11/14,
  rel_large = 16/14,
  color = "grey85",
  colour
)

theme_minimal_hgrid(
  font_size = 14,
  font_family = "",
  line_size = 0.5,
  rel_small = 12/14,
  rel_tiny = 11/14,
  rel_large = 16/14,
  color = "grey85",
  colour
)
}
\arguments{
\item{font_size}{Overall font size.}

\item{font_family}{Font family for plot title, axis titles and labels, legend texts, etc.}

\item{line_size}{Line size for grid lines.}

\item{rel_small}{Relative size of small text (e.g., axis tick labels)}

\item{rel_tiny}{Relative size of tiny text (e.g., caption)}

\item{rel_large}{Relative size of large text (e.g., title)}

\item{color, colour}{Color of grid lines.}
}
\description{
Three minimalistic themes that provide either a full grid,
a horizontal grid, or a vertical grid. Similar to \code{\link[=theme_minimal]{theme_minimal()}}, but with some
stylistic differences. Most importantly, these themes do not draw minor grid lines.
Also, font sizes are coordinated with \code{\link[=theme_half_open]{theme_half_open()}} and with the defaults
in the \code{\link[=save_plot]{save_plot()}} function.
}
\details{
\code{theme_minimal_grid()} provides a minimal grid theme. \code{theme_minimal_hgrid()} strips down
this theme even further and draws only horizontal lines, and \code{theme_minimal_vgrid()}
does the same for vertical lines.
}
\examples{
library(ggplot2)

# theme_minimal_grid()
ggplot(iris, aes(x = Sepal.Length, y = Sepal.Width, color = Species)) +
  geom_point() + theme_minimal_grid()

# theme_minimal_hgrid()
ggplot(mtcars, aes(x = carb)) +
  geom_bar(fill = "lightblue") +
  scale_y_continuous(limits = c(0, 11.5), expand = c(0, 0)) +
  theme_minimal_hgrid()

# theme_minimal_vgrid()
ggplot(mtcars, aes(x = carb)) +
  geom_bar(fill = "lightblue") +
  scale_y_continuous(limits = c(0, 11.5), expand = c(0, 0)) +
  coord_flip() +
  theme_minimal_vgrid()
}