View source: R/geom_encircle.R
geom_encircle_vivi | R Documentation |
Automatically enclose points in a polygon
geom_encircle_vivi(
mapping = NULL,
data = NULL,
stat = "identity",
position = "identity",
na.rm = FALSE,
show.legend = NA,
inherit.aes = TRUE,
...
)
mapping |
mapping |
data |
data |
stat |
stat |
position |
position |
na.rm |
na.rm |
show.legend |
show.legend |
inherit.aes |
inherit.aes |
... |
dots |
This function adds a polygon around a set of points, to highlight them.
adds a circle around the specified points
library(ggplot2)
d <- data.frame(x=c(1,1,2),y=c(1,2,2)*100)
gg <- ggplot2::ggplot(d,aes(x,y))
gg <- gg + scale_x_continuous(expand=c(0.5,1))
gg <- gg + scale_y_continuous(expand=c(0.5,1))
gg + geom_encircle_vivi(s_shape=1, expand=0) + geom_point()
gg + geom_encircle_vivi(s_shape=1, expand=0.1, colour="red") + geom_point()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.