The goal of ggshapes is to add more shapes such and stars and other curves to ggplot2 the same way ggforce adds regular polygons and circles.

Installation

You can install the released version of ggshapes from CRAN with:

And the development version from GitHub with:

Examples

ggshapes provides many closed curves, one of which is the simple rose curve.

Each of these geoms comes with some tuning parameters that result in widely different curves so you should play around.

ggshapes doesn’t natively work with gganimate but gifs can be hacked together using gifski.

Design choices

All the geoms that produces closed curves (under certain choice of parameters) comes with a couple of geom specifit tuning parameters (n, d and c for geom_star()) and some shared aesthetics

  • x0
  • y0
  • xscale
  • yscale
  • rotation

which denote the x and y coordinate of the center, the x and y scaling of the curve and its rotation in radians. By defaults the geoms produces curves bounded between -1 and 1, centered around (0, 0). Rotation is not applied by default. If rotation and scaling is applied then the curve will not be bounded anymore (as it retains its scale).

Inspiration

The original inspiration for this package came from the post film flowers by Shirley Wu which drove me to the realization that such visualizations are quite the hassle to do in ggplot2 right now.