theme_clean: Clean visualization themes

Description Usage Arguments Details Note Examples

View source: R/gg_clean.R

Description

Clean up plots from their defaults.

Usage

1
2
3
4
5
6
7
theme_clean(font_size = 12, font_family = "", center_axis_labels = FALSE)

theme_trueMinimal(font_size = 12, font_family = "", center_axis_labels = FALSE)

theme_plotly(vis, MB = FALSE)

theme_blank(vis, MB = FALSE)

Arguments

font_size

Font size for axis labels in theme_clean

font_family

Font family for axis labels in theme_clean

center_axis_labels

Logical. Center axis labels in theme_clean. Default is FALSE.

vis

A visualization created by ggplot2 or plotly.

MB

For plotly, an option to display the mode bar. Defaults to FALSE.

Details

From a gray background, to unnecessary gridlines, to by-default reference lines, some of the more popular visualization packages come out 75\ functions remove unnecessary gridlines, 'de-bold' the blacks, etc.

Note

You may continue to override any aspect of these themes. For example with ggplot2, you would just add a theme afterward just like you would any other plot.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
library(visibly)
library(ggplot2)

data(mtcars)

ggplot(aes(wt, mpg), data=mtcars) +
  geom_point() +
  labs(title='Plot') +
  theme_clean()

ggplot(aes(wt, mpg), data=mtcars) +
  geom_point() +
  labs(title='Plot') +
  theme_clean(center_axis_labels = TRUE)

library(plotly)
mtcars %>%
  plot_ly(x=~wt, y=~mpg, mode='markers') %>%
  theme_plotly()

mtcars %>%
  plot_ly(x=~wt, y=~mpg, mode='markers') %>%
  theme_blank()

m-clark/visibly documentation built on Oct. 28, 2020, 5:33 p.m.