ggpoint: Grob function: point

View source: R/grobs-basic.r

ggpointR Documentation

Grob function: point

Description

Aesthetic mappings that this grob function understands:

Usage

ggpoint(plot, aesthetics = list(), ..., data = NULL)

Arguments

plot

the plot object to modify

aesthetics

named list of aesthetic mappings, see details for more information

...

other options, see details for more information

data

data source, if not specified the plot default will be used

Details

  • x:x position (required)

  • y:y position (required)

  • size:size of the point, in mm (see scsize)

  • shape:shape of the glyph used to draw the point (see scshape)

  • colour:point colour (see sccolour)

These can be specified in the plot defaults (see ggplot) or in the aesthetics argument. If you want to modify the position of the points or any axis options, you will need to add a position scale to the plot. These functions start with ps, eg. pscontinuous or pscategorical

Other options:

  • unique:if TRUE, draw at most one point at each unique location

Examples

p <- ggplot(mtcars, aesthetics=list(x=wt, y=mpg))
ggpoint(p)
ggpoint(p, list(colour=cyl))
ggpoint(p, list(blahbalh=cyl)) #unknown aesthetics are ignored
ggpoint(p, list(shape=cyl))
ggpoint(p, list(shape=cyl, colour=cyl))
ggpoint(p, list(size=mpg))
ggpoint(p, list(size=mpg/wt))
ggpoint(p, list(x=cyl, colour=cyl))
p <- ggplot(mtcars)
ggpoint(p, aesthetics=list(x=wt, y=mpg))

hadley/ggplot1 documentation built on Dec. 1, 2024, 11:23 a.m.