Skip to contents

Make a ggplot into CKB style

Usage

ckb_style(
  xlims = NULL,
  ylims = NULL,
  gap = c(0.025, 0.025),
  ext = c(0, 0),
  ratio = 1.5,
  width = NULL,
  height = NULL,
  base_size = 11,
  base_line_size = base_size/22,
  colour = "black",
  plot.margin = margin(0.5, 1.5, 0.5, 0.5, "lines"),
  axes = "both"
)

Arguments

xlims

A numeric vector of length two. The limits of the x-axis.

ylims

A numeric vector of length two. The limits of the y-axis.

gap

A numeric vector of length two. The gap between plotting area and axis to the left and bottom of the plot, as a proportion of the x-axis length. (Default: c(0.025, 0.025))

ext

A numeric vector of length two. The extensions to add to the right and top of the plot, as a proportion of the x-axis length. (Default: c(0, 0))

ratio

The ratio (y-axis:x-axis) to use for the plot. Ignored if both width and height are set. (Default: 1.5)

width

A grid::unit object to set the width of the plot (not including the gap or extension).

height

A grid::unit object to set the height of the plot (not including the gap or extension).

base_size

base font size, given in pts.

base_line_size

base size for line elements

colour

Colour for non-data aspects of the plot. (Default: "black")

plot.margin

Margin around entire plot (Default: margin(0.5, 0, 0.5, 0, "lines"))

axes

Choice of axis lines to add to the plot, one of "both", "x" or "y". (Default: "both")