Methods for Plotting Objects of Class pgrid or pp

Share:

Description

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

Usage

1
2
3
4
5
6
  ## S3 method for class 'pgrid'
plot(x, y = NULL, tplan = NULL, mass = c("colour", "thickness"),
    length = 0.1, acol, lwd, rot = FALSE, overlay = FALSE, static.mass =TRUE, ...)
  ## S3 method for class 'pp'
plot(x, y = NULL, tplan = NULL, cols = c(2, 4), cex = 0.8,
    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

For pgrid objects with a tplan: if mass == "colour", the mass to be transferred is depicted by heatmap colours; if mass == "thickness", it is depicted by the line widths of the arrows.

length

The length of the arrow heads in inches.

acol

The colour of the arrows/lines of the transference plan.

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