Learn R Programming

ggsubplot (version 0.3.1.9000)

geom_star: Star glyphs

Description

geom_star draws the type of glyph commonly called a star plot, radar plot, or polar plot.

Usage

geom_star(mapping = NULL, data = NULL, stat = "identity", position = "identity", na.rm = FALSE, r.zero = TRUE, ...)

Arguments

mapping
The aesthetic mapping, usually constructed with aes. Only needs to be set at the layer level if you are overriding the plot defaults. x and y will determine where the center of the star should appear. r and angle will determine the polar coordinate system for the star.
data
A layer specific dataset - only needed if you want to override the plot defaults
stat
The statistical transformation to use for this layer.
position
The position adjustment to use for overlapping points in this layer
na.rm
If FALSE (the default), removes missing values with a warning. If TRUE, silently removes missing variables.
r.zero
logical. Should the origin of the star correspond to r = 0? If FALSE, origin corresponds to lowest value of r.
...
other arguments passed on to layer. This can include aesthetics whose values you want to set, not map. See layer for more details.

Aesthetics

geom_star understands the following aesthetics: x, y, colour, fill, size, linetype, weight, and alpha.

Examples

Run this code
library(ggplot2)
ggplot(nasa) +
#    borders("state") +
  geom_subplot(aes(long, lat, group = id, subplot =
    geom_star(
      aes(x = 0, y = 0, r = surftemp, angle = date, fill = mean(surftemp)),
      r.zero = FALSE
   ))
  ) +
  coord_quickmap()

Run the code above in your browser using DataLab