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, as a string. |
position | Position adjustment, either as a string, or the result of a call to a position adjustment function. |
... | 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 |
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)) # }