View source: R/heat_tree--shape_generators.R
line_coords | R Documentation |
Generates an n x 2 matrix containing x and y coordinates between 1 and 0 for the points of a line with a specified width in cartesian coordinates.
line_coords(x1, y1, x2, y2, width)
x1 |
( |
y1 |
( |
x2 |
( |
y2 |
( |
width |
( |
## Not run:
library(ggplot2)
ggplot(data = line_coords(x1 = 1, y1 = 1, x2 = 2, y2 = 2, width = .1)) +
geom_polygon(aes(x = x, y = y, fill = group))
ggplot(data = line_coords(x1 = rnorm(10), y1 = rnorm(10), x2 = rnorm(10),
y2 = rnorm(10), width = rnorm(10)/5)) +
geom_polygon(aes(x = x, y = y, fill = group))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.