sp_ggplot_layout: Change common layout of ggplot2 object

Description Usage Arguments Value Examples

View source: R/utilities.R

Description

Change common layout of ggplot2 object

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
sp_ggplot_layout(
  p,
  xtics_angle = 0,
  legend.position = "right",
  extra_ggplot2_cmd = NULL,
  filename = NULL,
  x_label = NULL,
  y_label = NULL,
  title = NULL,
  coordinate_flip = FALSE,
  ylim = NULL,
  width = 12,
  height = 6.18,
  fontname = "",
  base_font_size = 10,
  additional_theme = NULL,
  zoom_split = FALSE,
  zoom_xlim = NULL,
  zoom_ylim = NULL,
  saveppt = FALSE,
  savehtml = FALSE,
  ...
)

Arguments

p

A ggplot2 object

xtics_angle

Rotation angle for a-axis. Default 0.

legend.position

Position of legend, accept top, bottom, left, right, none or c(0.8,0.8).

extra_ggplot2_cmd

Extra ggplot2 commands (currently unsupported)

filename

Output picture to given file.

x_label

Xlab label.

y_label

Ylab label.

title

Title of picture.

coordinate_flip

Flip cartesian coordinates so that horizontal becomes vertical, and vertical, horizontal. This is primarily useful for converting geoms and statistics which display y conditional on x, to x conditional on y.

width

Picture width (units: cm)

height

Picture height (units: cm)

zoom_split

If both x and y is given, should each axis zoom be shown separately as well? Defaults to FALSE.

zoom_xlim

Specific zoom ranges for x axis.

zoom_ylim

Specific zoom ranges for y axis.

saveppt

Output PPT format.

savehtml

Save the images as HTML files.

...

Extra parameters to ggsave.

Value

A ggplot2 object

Examples

1
2
3
4
## Not run:
sp_ggplot_layout(p)

## End(Not run)

Tong-Chen/YSX documentation built on Jan. 25, 2021, 2:49 a.m.