moonGrob {gggibbous} | R Documentation |
Draw a moon
Description
Functions to create and draw crescent or gibbous moon shapes.
Usage
moonGrob(
x,
y,
ratio = 0.25,
right = TRUE,
r = 10,
angle = 0,
default.units = "npc",
size.units = "mm",
...
)
grid.moon(..., draw = TRUE)
Arguments
x |
A numeric vector or unit object specifying x-locations. |
y |
A numeric vector or unit object specifying y-locations. |
ratio |
A numeric vector with values from 0 to 1 specifying the proportion of the moons to draw. |
right |
A boolean vector specifying whether the moon should be filled from the right (TRUE) or left (FALSE). |
r |
A numeric vector specifying the radii of the circles describing the moons. |
angle |
Not used. |
default.units |
A string indicating the default units to use
if |
size.units |
A string indicating the units to use for the radii of the moons. |
... |
Arguments passed on to |
draw |
A logical value indicating whether graphics output should be produced. |
Details
Both functions create a moon grob (a graphical object describing a crescent
or gibbous moon), but only grid.moon
draws the moon (and then only
if draw is TRUE).
These functions calculate a set of points describing the perimeters of the
moons and pass these points on to grid::polygonGrob
.
The units in default.units
and size.units
can be different;
grid
will add them together appropriately before drawing.
Value
A grob object.
Examples
grid::grid.newpage()
grid.moon(x = 1:3 * 0.25, y = rep(0.5, 3), ratio = 1:3 * 0.25, r = 10)