View source: R/geom_spikelines.R
geom_spikelines | R Documentation |
Segment reference lines that originate at an point
geom_spikelines(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
...,
arrow = NULL,
lineend = "butt",
linejoin = "round",
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE
)
mapping |
Set of aesthetic mappings created by |
data |
The data to be displayed in this layer. There are three options: If A A |
stat |
The statistical transformation to use on the data for this
layer, either as a |
position |
Position adjustment, either as a string naming the adjustment
(e.g. |
... |
Other arguments passed on to |
arrow |
Arrow specification, as created by |
lineend |
Line end style (round, butt, square). |
linejoin |
Line join style (round, mitre, bevel). |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
Jonathan Sidi
mtcars$name <- rownames(mtcars)
p <- ggplot(data = mtcars, aes(x=mpg,y=disp)) + geom_point()
p + geom_spikelines(data = mtcars[mtcars$carb==4,],linetype = 2)
p + geom_spikelines(data = mtcars[mtcars$carb==4,],aes(colour = factor(gear)), linetype = 2)
## Not run:
require(ggrepel)
p + geom_spikelines(data = mtcars[mtcars$carb==4,],aes(colour = factor(gear)), linetype = 2) +
ggrepel::geom_label_repel(data = mtcars[mtcars$carb==4,],aes(label = name))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.