Methods for plotting objects of class pgrid, pp and wpp, possibly together with a transference plan.
# S3 method for 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 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 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, ...)
Used for its side effect.
one or two objects of class pgrid
or class pp
to be plotted.
a transference plan between the two objects x
and y
,
typically an optimal transference plan obtained by a call to transport
.
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.
the length of the arrow heads in inches.
for wpp
objects with tmass = TRUE
: the grey level
chosen for depicting the transport of an average amount of mass.
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
.
the angle of the arrow heads.
the colour of the cell boundaries for a semidiscrete transport plan. Ignored in all other instances.
the colour of the points representing the discrete masses for a semidiscrete transport plan. Ignored in all other instances.
for pp
objects:
A vector of size 2 specifying the colours of the two pp
objects.
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.
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
.
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.
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"
.
Dominic Schuhmacher dschuhm1@uni-goettingen.de