This, rather pointless, geom allows you to draw spirograms, as known from the popular drawing toy where lines were traced by inserting a pencil into a hole in a small gear that would then trace around inside another gear. The potential practicality of this geom is slim and it excists mainly for fun and art.
stat_spiro(mapping = NULL, data = NULL, geom = "path", position = "identity", na.rm = FALSE, n = 500, revolutions = NULL, show.legend = NA, inherit.aes = TRUE, ...) geom_spiro(mapping = NULL, data = NULL, stat = "spiro", position = "identity", arrow = NULL, n = 500, lineend = "butt", na.rm = FALSE, show.legend = NA, inherit.aes = TRUE, ...)
Set of aesthetic mappings created by
The data to be displayed in this layer. There are three options:
The geometric object to use display the data
Position adjustment, either as a string, or the result of a call to a position adjustment function.
The number of points that should be used to draw a fully closed
The number of times the inner gear should revolve around
inside the outer gear. If
logical. Should this layer be included in the legends?
Other arguments passed on to
The statistical transformation to use on the data for this layer, as a string.
Arrow specification, as created by
Line end style (round, butt, square).
stat_spiro and geom_spiro understand the following aesthetics (required aesthetics are in bold):
The coordinates for the path describing the spirogram
The progression along the spirogram mapped between 0 and 1
# Basic usage ggplot() + geom_spiro(aes(R = 10, r = 3, d = 5))# Only draw a portion ggplot() + geom_spiro(aes(R = 10, r = 3, d = 5), revolutions = 1.2)# Let the inner gear circle the outside of the outer gear ggplot() + geom_spiro(aes(R = 10, r = 3, d = 5, outer = TRUE))