orditkplot
produces an editable ordination plot with
points and labels. The labels can be moved with mouse, and the edited
plot can be saved as an encapsulated postscript file or exported via R
plot
function to other graphical formats, or saved in the R session
for further processing.
orditkplot(x, display = "species", choices = 1:2, width, xlim, ylim, tcex = 0.8, tcol, pch = 1, pcol, pbg, pcex = 0.7, labels, ...)
"plot"(x, ...)
"points"(x, pch = x$args$pch, cex = x$args$pcex, col = x$args$pcol, bg = x$args$pbg, ...)
"text"(x, cex = x$args$tcex, col = x$args$tcol, font = attr(x$labels, "font"), ...)
"scores"(x, display, ...)
scores
can handle, or for the plot
function the
object dumped from the interactive orditkplot
session.scores
displayed. For ordination
scores this typically is either "species"
or "sites"
,
and for orditkplot
result it is either "points"
or
"labels"
.pcol="black"
and pbg="transparent"
.
Argument pbg
has an effect only in filled plotting characters
pch = 21
to 25
.points
and text
methods. See par
.orditkplot
uses tcltk package to draw
Tcl/Tk based ordination graphics with points and labels. The function
opens an editable canvas with fixed points, but the labels can be
dragged with mouse to better positions or edited. In addition, it is
possible to zoom to a part of the graph.The function knows the following mouse operations:
In addition there are buttons for the following tasks: Copy
to EPS copies the current plot to an encapsulated postscript (eps)
file using standard Tcl/Tk utilities. The faithfulness of this copy
is system dependent. Button Export plot uses
plot.orditkplot
function to redraw the plot into graphical
file formats. Depending on the system, the following graphical
formats may be available: eps, pdf, svg, png, jpeg, tiff, bmp or
xfig. Some of the output formats may be edited with external
software: svg files with Illustrator or Inkscape, and xfig with the
legacy program XFig. Button Dump to R writes the edited
coordinates of labels and points to the R session for further
processing, and the plot.orditkplot
function can be used to
display the results. For faithful replication of the plot, the graph
must have similar dimensions as the orditkplot
canvas had
originally. The plot
function cannot be configured, but it
uses the same settings as the original Tcl/Tk plot. However,
points
and text
functions are fully configurable, but
use the stored defaults for consistency with plot.orditkplot
if
non are supplied by the user. Finally, button Dismiss closes
the window.
The produced plot will have equal aspect ratio. The width of the
horizontal axis is fixed, but vertical axes will be scaled to needed
height, and you can use scrollbar to move vertically if the whole
canvas does not fit the window. If you use dumped labels in ordinary
R plots, your plot must have the same dimensions as the
orditkplot
canvas to have identical location of the labels.
The function only displays one set of scores. However, you can use
ordipointlabel
to produce a result object that has
different points and text types for several sets of scores and this
can further edited with orditkplot
. For a good starting
solution you need to scale the ordipointlabel
result so
that the points span over the whole horizontal axis.
The plot is a Tcl/Tk canvas, but the function tries to replicate
standard graphical device of the platform, and it honours several
graphical parameters (see par
). Many of the graphical
parameters can be given on the command line, and they will be passed
to the function without influencing other graphical devices in R.
At the moment, the
following graphical parameters are honoured:
pch
bg
, cex
,
cex.axis
, cex.lab
, col
(for labels),
col.axis
, col.lab
, family
(for font faces),
fg
, font
, font.axis
, font.lab
,
lheight
, lwd
(for the box), mar
, mex
,
mgp
, ps
, tcl
. These can be set with
par
, and they also will influence other plots similarly.
The tkcanvas
text cannot be rotated, and
therefore vertical axis is not labelled, and las
par
ameter will not be honoured in the Tcl/Tk plot, but
it will be honoured in the exported R plots and in
plot.orditkplot
.
ordipointlabel
is an automatic
procedure with similar goals of avoiding overplotting.
See ordiplot
, plot.cca
,
ordirgl
and orditorp
for alternative
ordination plots, and scores
for extracting ordination
scores. ## The example needs user interaction and is not executed directly.
## It should work when pasted to the window.
## Not run:
# data(varespec)
# ord <- cca(varespec)
# ## Do something with the graph and end by clicking "Dismiss"
# orditkplot(ord, mar = c(4,4,1,1)+.1, font=3)
# ## Use ordipointlabel to produce a plot that has both species and site
# ## scores in different colors and plotting symbols
# pl <- ordipointlabel(ord)
# orditkplot(pl)
# ## End(Not run)
Run the code above in your browser using DataLab