ggstar: star layer for ggplot2
To create the regular polygon layer for easily discernible shapes, we developed the package, it can be easily used if you know the ‘ggplot2’.
✍️ Author
School of Basic Medical Sciences, Southern Medical University
⏬ Installation
Get the released version from CRAN:
install.packages("ggstar")Or the development version from github:
if (!requireNamespace("devtools", quietly=TRUE))
install.packages("devtools")
devtools::install_github("xiangpin/ggstar")🔰 Usage
Total starshapes:
library(ggplot2)
library(ggstar)
p <- ggplot(data=mtcars,
mapping=aes(x=wt,
y=mpg,
fill=cyl)) +
geom_star()
pp2 <- ggplot(data=iris,
mapping=aes(x=Sepal.Length,
y=Sepal.Width,
fill=Species)) +
geom_star()
p2p3 <- ggplot(data=iris,
mapping=aes(x=Sepal.Length,
y=Sepal.Width,
fill=Species,
starshape=Species)) +
geom_star() + scale_starshape_manual(values=c(1, 2, 9))
p3📖 Vignette
For more details, please refer to the online vignette
If you have installed it, you can also view the vignette on local.
browseVignettes("ggstar")💖 Contributing
We welcome any contributions! By participating in this project you agree to abide by the terms outlined in the Contributor Code of Conduct.




