geom_arc: Arcs

Description Usage Arguments Examples

View source: R/geom_arc.R

Description

'geom_arc' draws an arc of center (x, y), with a custom radius, angle and width. Couyld be useful for custom data visualisation, or distribution or vector fields. For those scenarios it's more convenient than geom-segment.

Usage

1
2
3
4
5
geom_arc(mapping = NULL, data = NULL, stat = "identity",
  position = "identity", ..., arrow = NULL, arrow.fill = NULL,
  lineend = "butt", linejoin = "round", res = pi/20, reverse = T,
  relative = F, normalise = F, na.rm = FALSE, show.legend = NA,
  inherit.aes = TRUE)

Arguments

mapping

Set of aesthetic mappings created by aes() or aes_(). If specified and inherit.aes = TRUE (the default), it is combined with the default mapping at the top level of the plot. You must supply mapping if there is no plot mapping. The geom_arc is characterised by specific aes that encore different dimensions: 'radius' is explicit, 'width': the length of the arc, 'angle': the position of the arc and 'start' [0-1] the relative position of the starting point of the arc (0.5 by default).

arrow

specification for arrow heads, as created by arrow().

arrow.fill

fill colour to use for the arrow head (if closed). 'NULL' means use 'colour' aesthetic.

lineend

Line end style (round, butt, square).

linejoin

Line join style (round, mitre, bevel).

res

angular resolution of the arc tracing, in radiant.

reverse

change the direction of the arc to be clockwise (TRUE by default because the calculation is based on the trigonometric positive direction that is anti-clockwise)

relative

if TRUE makes the 'width' aes() angular instead of linear (FALSE by default).

relative

if TRUE normalize the circle width relative to the maximum value of width to avoid overlapping (default = F).

Examples

1
iris %>% ggplot(aes(Sepal.Length , Petal.Length, colour = Species)) + geom_arc(width = 0.8, aes(angle = Petal.Width ,radius = 0.1*Sepal.Width)) + coord_fixed()

Clement-Viguier/ggvis documentation built on Nov. 6, 2019, 1:07 p.m.