geom_freehand: Freehand circles

Description Usage Arguments Details Aesthetics Examples

Description

Add freehand circles (default red) to a plot, similar to the style of Meta Stack Overflow (http://meta.stackexchange.com/a/19775/176330).

Usage

1
2
geom_freehand(mapping = NULL, data = NULL, stat = "identity",
  position = "identity", ...)

Arguments

mapping

The aesthetic mapping, usually constructed with aes or aes_string. Only needs to be set at the layer level if you are overriding the plot defaults.

data

A layer specific dataset - only needed if you want to override the plot defaults.

stat

The statistical transformation to use on the data for this layer.

position

The position adjustment to use for overlapping points on this layer

...

other arguments passed on to layer. This can include aesthetics whose values you want to set, not map. See layer for more details.

Details

The radius argument determines the radius of the freehand circles. It is normalized based on the scales such that a radius of 1 takes up 1/25 of the plot's width and height. You can also set the radius separately for the x- and y- axes with radiusx and radiusy.

Aesthetics

geom_freehand understands the following aesthetics (required aesthetics are in bold):

Examples

1
2
3
4
5
6
7
require("ggplot2")

p <- ggplot(mtcars, aes(wt, mpg))
p + geom_point()

one_car <- mtcars[1, ]
p + geom_point() + geom_freehand(data = one_car, rx = .1, ry = .5)

dgrtwo/ggfreehand documentation built on May 15, 2019, 7:27 a.m.