Learn R Programming

vegan (version 1.11-0)

orditkplot: Ordination Plot with Movable Labels

Description

Function 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 Rplot function to other graphical formats, or saved in the Rsession for further processing.

Usage

orditkplot(x, display = "species", choices = 1:2, width, xlim, ylim, 
   tcex = 0.8, pcol, pbg, pcex = 0.7, labels,  ...)
## S3 method for class 'orditkplot':
plot(x, ...)
## S3 method for class 'orditkplot':
points(x, ...)
## S3 method for class 'orditkplot':
text(x, ...)
## S3 method for class 'orditkplot':
scores(x, display, ...)

Arguments

x
An ordination result or any other object that scores can handle, or for the plot function the object dumped from the interactive orditkplot session.
display
Type of scores displayed. For ordination scores this typically is either "species" or "sites", and for orditkplot result it is either "points" or
choices
Axes displayed.
width
Width of the plot in inches; defaults to the current width of the graphical device.
xlim, ylim
x and y limits for plots: points outside these limits will be completely removed.
tcex
Character expansion for text labels.
pcol, pbg
Line and fill colours of points. Defaults pcol="black" and pbg="transparent".
pcex
Expansion factor for point size.
labels
Labels used instead of row names.
...
Other arguments passed to the function. These can be graphical parameters (see par) used in the plot, or extra arguments to scores. These arguments are

Value

  • Function returns nothing useful directly, but you can save the edited graph to a file or dump the edited positions to an Rsession for further processing and plotting.

Details

Function 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 moved with mouse to better positions. 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 faithfullness 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, png, jpeg or bmp. The file type is deduced from the file suffix or the selection of the file type in the dialog box. Alternatively, the same dialog can be used to save the plot to an editable xfig file. Button Dump to R writes the edited coordinates of labels and points to the Rsession 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, and unaware of the original Tcl/Tk plot settings (probably you must set cex at least to get a decent plot). 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 Rplots, your plot must have the same dimensions as the orditkplot canvas to have identical location of the labels.

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: 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 parameter will not be honoured in the Tcl/Tk plot, but it will be honoured in the exported Rplots and in plot.orditkplot.

See Also

ordiplot, plot.cca, ordirgl and orditorp for alternative ordination plots, and scores for extracting ordination scores.

Examples

Run this code
## The example needs user interaction and is not executed directly.
## It should work when pasted to the window.
data(varespec)
ord <- cca(varespec)
orditkplot(ord, mar = c(4,4,1,1)+.1, font=3)

Run the code above in your browser using DataLab