geom_star | R Documentation |
geom_star provides the multiple geometric shape to create scatter plot or other point plot, it is like the 'geom_point' of 'ggplot2'. Note: the 'left-triangle' (17, 19) and 'right-triangle' (18, 20) are developed to plot the 'triangle-heatmap'. Their centers are not in their internal, but the center of hypotenuse.
geom_star( mapping = NULL, data = NULL, na.rm = FALSE, stat = "identity", position = "identity", 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 |
na.rm |
If 'FALSE', the default, missing values are removed with a warning. If 'TRUE', missing values are silently removed. |
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. |
show.legend |
logical. Should this layer be included in the legends?
|
inherit.aes |
If |
... |
Other arguments passed on to |
starshape
the shape of point, default is 1 (star shape).
starstroke
control the thickness of margin of point, default is 0.5.
size
the size of point, default is 1.5.
colour
the colour of margin, default is 'black'.
fill
the colour of fill, default is NA.
alpha
the transparency of fill, default is 1.
angle
control the angle of rotation of point, default is 0.
subset
subset the data frame which meet conditions to display.
polygonal point layer
geom_star()
understands the following aesthetics (required aesthetics are in bold):
x
y
alpha
angle
colour
fill
group
phase
size
starshape
starstroke
subset
Learn more about setting these aesthetics in vignette("ggplot2-specs")
.
Shuangbin Xu
library(ggplot2) p <- ggplot(iris, aes(x=Sepal.Length, y=Sepal.Width, starshape=Species)) + geom_star(size=4) p
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.