Description Usage Arguments Aesthetics Author(s) Examples
This geom lets you annotate sets of points via hulls. While convex hulls are
most common due to their clear definition, they can lead to large areas
covered that does not contain points. Due to this geom_mark_hull
uses
concaveman which lets you adjust concavity of the resulting hull. The hull is
calculated at draw time, and can thus change as you resize the plot. In order
to clearly contain all points, and for aesthetic purpose the resulting hull
is expanded 5mm and rounded on the corners. This can be adjusted with the
expand
and radius
parameters.
1 2 3 4 |
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. |
expand |
A numeric or unit vector of length one, specifying the expansion amount. Negative values will result in contraction instead. If the value is given as a numeric it will be understood as a proportion of the plot area width. |
radius |
As |
concavity |
A meassure of the concavity of the hull. |
... |
other arguments passed on to |
na.rm |
If |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
geom_mark_hull understand the following aesthetics (required aesthetics are in bold):
x
y
filter
color
fill
group
size
linetype
alpha
Thomas Lin Pedersen
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ggplot(iris, aes(Petal.Length, Petal.Width)) +
geom_mark_hull(aes(fill = Species, filter = Species != 'versicolor')) +
geom_point()
# Adjusting the concavity lets you change the shape of the hull
ggplot(iris, aes(Petal.Length, Petal.Width)) +
geom_mark_hull(aes(fill = Species, filter = Species != 'versicolor'),
concavity = 1) +
geom_point()
ggplot(iris, aes(Petal.Length, Petal.Width)) +
geom_mark_hull(aes(fill = Species, filter = Species != 'versicolor'),
concavity = 10) +
geom_point()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.