web_display: Enlarges a ggplot2 plot for web display.

View source: R/web_display.R

web_displayR Documentation

Enlarges a ggplot2 plot for web display.

Description

web_display takes a ggplot object as input, and enlarges its axis tick text, axis label text, legend title and text, and distance between the axis labels and the axis to make it look good for web display.

Usage

web_display(
  p,
  axis_text_size = 16,
  axis_title_size = rel(2),
  axis_title_vjust_y = 1,
  mar_top = 1,
  mar_right = 1,
  mar_left = 1,
  mar_bottom = 1
)

Arguments

p

A ggplot object.

axis_text_size

A number, size of the tick text. Default = 16.

axis_title_size

A number, size of the axis labels. Default = rel(2).

axis_title_vjust_y

A number, distance between y label and y-axis. Default = 1.

mar_top

A number, top margin of the whole plot. Default = 1.

mar_right

A number, right margin of the whole plot. Default = 1.

mar_left

A number, left margin of the whole plot. Default = 1.

mar_bottom

A number, bottom margin of the whole plot. Default = 1.

Value

A ggplot object.

Examples

inst/examples/ex-web_display.R

gmlang/ezplot documentation built on Sept. 18, 2022, 6:33 a.m.