layer_lines: Layer lines on a plot.

View source: R/layer_lines.R

layer_linesR Documentation

Layer lines on a plot.

Description

layer_lines differs from layer_paths in that layer_lines sorts the data on the x variable, so the line will always proceed from left to right, whereas layer_paths will draw a line in whatever order appears in the data.

Usage

layer_lines(vis, ...)

Arguments

vis

Visualisation to modify.

...

Visual properties.

See Also

layer_paths

Examples

mtcars %>% ggvis(~wt, ~mpg, stroke = ~factor(cyl)) %>% layer_lines()

# Equivalent to
mtcars %>% ggvis(~wt, ~mpg, stroke = ~factor(cyl)) %>%
  group_by(cyl) %>% dplyr::arrange(wt) %>% layer_paths()

ggvis documentation built on May 29, 2024, 1:12 a.m.