draw_line: Draw a line from connected points

Description Usage Arguments Details See Also Examples

View source: R/draw.R

Description

Provide a sequence of x values and accompanying y values to draw a line on a plot.

Usage

1
draw_line(x, y, ...)

Arguments

x

Vector of x coordinates.

y

Vector of y coordinates.

...

geom_path parameters such as colour, alpha, size, etc.

Details

This is a convenience function, providing a wrapper around ggplot2's geom_path.

See Also

geom_path, ggdraw

Examples

1
2
3
4
5
6
ggdraw() +
  draw_line(
    x = c(0.2, 0.7, 0.7, 0.3),
    y = c(0.1, 0.3, 0.9, 0.8),
    color = "blue", size = 2
  )

Example output

Loading required package: ggplot2

Attaching package: 'cowplot'

The following object is masked from 'package:ggplot2':

    ggsave

cowplot documentation built on Dec. 30, 2020, 5:07 p.m.