View source: R/theme_less_minimal.R
theme_less_minimal | R Documentation |
Function for a minimal ggplot2 appearance but with bounding lines for plot area.
theme_less_minimal(
base_size = 11,
base_family = "",
base_line_size = base_size/22,
base_rect_size = base_size/22,
narrow_strips = TRUE,
x_label_rotate = 0,
legend_position = NA
)
theme_narrow_strips(x_strip_margin = 2.2, y_strip_margin = 2.5)
theme_x_label_rotate(angle = 45)
ggplot_caption_format(location = "left", size = NULL)
base_size |
Base font size. |
base_family |
Base font family. |
base_line_size |
Base size for line elements. |
base_rect_size |
Base size for rectangle elements. |
narrow_strips |
Should the plot have narrow strips for facet headings? |
x_label_rotate |
Angle for x-axes labels. |
legend_position |
The position of the legend ("none", "left", "right", "bottom", "top", or two-element numeric vector). |
x_strip_margin , y_strip_margin |
Margins for strip headings. |
angle |
Angle of text. |
location , size |
Specific arguments for |
Invisible, modification to a ggplot2 plot.
Stuart K. Grange
# Load package
library(ggplot2)
# Create data
data_example <- tibble::tibble(
x = seq(1:3),
y = sample(1:10, 3),
facet_heading = "The plot"
)
# Plot with the theme
ggplot(data_example, aes(x, y)) +
geom_point() +
facet_wrap("facet_heading") +
theme_less_minimal()
# Plot with the theme with some options
ggplot(data_example, aes(x, y)) +
geom_point() +
facet_wrap("facet_heading") +
theme_less_minimal(narrow_strips = TRUE, x_label_rotate = 45)
# Plot and move legend
ggplot(data_example, aes(x, y, colour = facet_heading)) +
geom_point() +
theme_less_minimal(legend_position = "bottom")
# Plot and move legend
ggplot(data_example, aes(x, y, colour = facet_heading)) +
geom_point() +
theme_less_minimal() +
labs(caption = "A caption") +
ggplot_caption_format(size = 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.