Learn R Programming

spatstat.geom (version 3.6-0)

invoke.symbolmap: Plot Data Using Graphics Symbol Map

Description

Apply a graphics symbol map to a vector of data values and plot the resulting symbols.

Usage

invoke.symbolmap(map, values, x=NULL, y = NULL, ...,
                 angleref=NULL,
                 add = FALSE,
                 do.plot = TRUE, started = add && do.plot)

Arguments

Value

(Invisibly) the maximum diameter of the symbols, in user coordinate units.

Details

A symbol map is an association between data values and graphical symbols.

This command applies the symbol map map to the data values and plots the resulting symbols at the locations given by xy.coords(x,y).

See Also

plot.symbolmap to plot the graphics map itself.

symbolmap to create a graphics map.

Examples

Run this code
  g <- symbolmap(range=c(-1,1),
                   shape=function(x) ifelse(x > 0, "circles", "squares"),
                   size=function(x) sqrt(ifelse(x > 0, x/pi, -x))/15,
                   bg=function(x) ifelse(x > 0, "green", "red"))
  plot(square(1), main="")
  a <- invoke.symbolmap(g, runif(10, -1, 1), runifrect(10), add=TRUE)
  a 

Run the code above in your browser using DataLab