Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

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, ..., add = FALSE,
               do.plot = TRUE, started = add && do.plot)

Arguments

map

Graphics symbol map (object of class "symbolmap").

values

Vector of data that can be mapped by the symbol map.

x,y

Coordinate vectors for the spatial locations of the symbols to be plotted.

...

Additional graphics parameters.

add

Logical value indicating whether to add the symbols to an existing plot (add=TRUE) or to initialise a new plot (add=FALSE, the default).

do.plot

Logical value indicating whether to actually perform the plotting.

started

Logical value indicating whether the plot has already been initialised.

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).

Value

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

Author(s)

and Ege Rubak rubak@math.aau.dk.

See Also

plot.symbolmap to plot the graphics map itself.

symbolmap to create a graphics map.

Examples

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

spatstat.geom

Geometrical Functionality of the 'spatstat' Family

v2.1-0
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Tilman Davies [ctb], Ute Hahn [ctb], Abdollah Jalilian [ctb], Sebastian Meyer [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Waagepetersen [ctb]
Initial release
2021-04-15

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.