plot: Methods for Plotting Objects of Class pgrid, pp and wpp

plotR Documentation

Methods for Plotting Objects of Class pgrid, pp and wpp

Description

Methods for plotting objects of class pgrid, pp and wpp, possibly together with a transference plan.

Usage

  ## S3 method for class 'pgrid'
plot(x, y = NULL, tplan = NULL, mass = c("colour", "thickness"),
    length = 0.1, angle = 5, acol, bcol = 4, pcol="goldenrod2", lwd, pmass=TRUE,
    rot = FALSE, overlay = FALSE, static.mass =TRUE, ...)
  ## S3 method for class 'pp'
plot(x, y = NULL, tplan = NULL, cols = c(4, 2), cex = 0.8,
    acol = grey(0.3), lwd = 1, overlay = TRUE, ...)
  ## S3 method for class 'wpp'
plot(x, y = NULL, tplan = NULL, pmass=TRUE, tmass=TRUE, cols = c(4, 2),
    cex = 0.8, aglevel = 0.4, acol = grey(0.3), lwd = 1, overlay = TRUE, ...)

Arguments

x,y

one or two objects of class pgrid or class pp to be plotted.

tplan

a transference plan between the two objects x and y, typically an optimal transference plan obtained by a call to transport.

mass, pmass, tmass

for pgrid objects with a tplan: if mass == "colour", the mass transferred is depicted by heatmap colours; if mass == "thickness", it is depicted by the line widths of the arrows.
For wpp objects: pmass, tmass are logicals controlling whether the amount of mass associated with the points and the mass transferred should be depicted in the plot.

length

the length of the arrow heads in inches.

aglevel

for wpp objects with tmass = TRUE: the grey level chosen for depicting the transport of an average amount of mass.

acol

the colour of the arrows/lines of the transference plan. Ignored for pgrid objects if mass = "colour" and for wpp objects if tmass is TRUE.

angle

the angle of the arrow head.

bcol

the colour of the cell boundaries for a semidiscrete transport plan. Ignored in all other instances.

pcol

the colour of the points representing the discrete masses for a semidiscrete transport plan. Ignored in all other instances.

cols

for pp objects: A vector of size 2 specifying the colours of the two pp objects.

cex,lwd,...

further graphic parameters used by plot. Note that for pgrid objects acol is ignored for mass == "colour", and lwd is ignored for mass == "thickness". Setting any of these parameters is optional.

rot

logical. Whether the mass matrices of pgrid objects should be rotated before calling image so that the orientation of the ploted pixelgrid and the orientation of the mass matrix are the same. Otherwise plotting follows the usual convention of image.

overlay

in the case of two objects x and y whether they should be plotted on top of one another (for pgrid objects the difference x-y is plotted) or not. In the presence of a transference plan overlay is forced to be true.

static.mass

for a transference plan that explicitly lists the “static mass transports” (i.e. mass that stays at the same site), should these transports also be plotted as disks with colours/sizes corresponding to the amount of mass that stays?
Note that it is wrong to assume that an optimal transference plan obtained by one of the algorithms will automatically list static mass transports. It is not the case for p=1, where static mass transport at site i is trivially equal to the minimum of source mass and target mass, and it is currently not the case for results obtained by method="aha".

Value

Used for its side effect.

Author(s)

Dominic Schuhmacher dschuhm1@uni-goettingen.de


transport documentation built on July 9, 2023, 7:43 p.m.