
ordipointlabel
produces ordination plots with
points and text label to the points. The points are in the exact
location given by the ordination, but the function tries to optimize
the location of the text labels to minimize overplotting text. The
function may be useful with moderately crowded ordination plots.ordipointlabel(x, display = c("sites", "species"), choices = c(1, 2),
col = c(1, 2), pch = c("o", "+"), font = c(1, 1),
cex = c(0.8, 0.8), add = FALSE, select, ...)## S3 method for class 'ordipointlabel':
plot(x, ...)
ordipointlabel()
a result object from an
ordination function. For plot.ordipointlabel
an object
resulting from a call to ordipointlabel()
.display
.TRUE
for displayed items or a vector of indices
of displayed items. select
is only used if a single set of
scores is being plotted (i.e. lengt
ordipointlabel
with items xy
for coordinates of
points, labels
for coordinates of labels, items pch
,
cex
and font
for graphical parameters of each point or
label. In addition, it returns the result of optim
as
an attribute "optim"
. The unit of overlap is the area
of character "m"
, and with variable cex
it is the
smallest alternative. There is a plot
method based on orditkplot
but which
does not alter nor reset the graphical parameters via par
.
The result object from ordipointlabel
inherits from
orditkplot
, and can also be replotted with its
plot
method. It may be possible to further edit the result
object with orditkplot
, but for good results it is
necessary that the points span the whole horizontal axis without empty
margins.
optim
,
method = "SANN"
) to optimize the location of the text labels
to the points. There are eight possible locations: up, down, sides
and corners. There is a weak preference to text right above the
point, and a weak avoidance of corner positions. The exact locations
and the goodness of solution varies between runs, and there is no
guarantee of finding the global optimum. The optimization can take a
long time in difficult cases with a high number of potential
overlaps. Several sets of scores can be displayed in one plot. The function is modelled after pointLabel
in
S4
packages).
pointLabel
for references.pointLabel
for the model
implementation, and optim
for the optimization.data(dune)
ord <- cca(dune)
plt <- ordipointlabel(ord)
## set scaling - should be no warnings!
ordipointlabel(ord, scaling = 1)
## plot then add
plot(ord, scaling = 3, type = "n")
ordipointlabel(ord, display = "species", scaling = 3, add = TRUE)
ordipointlabel(ord, display = "sites", scaling = 3, add = TRUE)
## redraw plot without rerunning SANN optimisation
plot(plt)
Run the code above in your browser using DataLab