Learn R Programming

aelab (version 1.1.0)

plot_line: plot_line

Description

Create a line plot using the aelab theme.

Usage

plot_line(
  df,
  x,
  y,
  z = NULL,
  base_size = 25,
  line_width = 3,
  text_color = "black",
  facet = FALSE,
  facet_x = NULL,
  facet_y = NULL,
  style = "bw"
)

Value

A ggplot object.

Arguments

df

A data frame.

x

<[`data-masking`][ggplot2::aes]> Column mapped to the x-axis.

y

<[`data-masking`][ggplot2::aes]> Column mapped to the y-axis.

z

<[`data-masking`][ggplot2::aes]> Optional column mapped to colour and group.

base_size

Base font size. Default 25.

line_width

Line width. Default 3.

text_color

Text colour. Default "black".

facet

Logical; add facet grid? Default FALSE.

facet_x

Column name (string) for the horizontal facet dimension.

facet_y

Column name (string) for the vertical facet dimension.

style

Theme style. Default "bw".

Examples

Run this code
if (FALSE) {
df <- data.frame(x = 1:6, y = c(1,3,2,5,4,6), g = rep(c("A","B"), 3))
plot_line(df, x, y, g)
}

Run the code above in your browser using DataLab