Skip to content

Commit

Permalink
Merge branch 'issue-685': fixes #685
Browse files Browse the repository at this point in the history
  • Loading branch information
jarioksa committed Nov 21, 2024
2 parents ba23987 + 54d0f45 commit eb8b669
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 10 deletions.
5 changes: 3 additions & 2 deletions R/ordiplot.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
if (inherits(ord, "decorana") || inherits(ord, "cca")) {
if (missing(display))
out <- plot(ord, choices = choices, type = type, xlim = xlim,
ylim = ylim, ...)
ylim = ylim, optimize = optimize, arrows = arrows, ...)
else out <- plot(ord, choices = choices, type = type, display = display,
xlim = xlim, ylim = ylim, ...)
xlim = xlim, ylim = ylim, optimize = optimize,
arrows = arrows, ...)
}
else {
type <- match.arg(type, c("points", "text", "none"))
Expand Down
8 changes: 3 additions & 5 deletions R/plot.cca.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
`plot.cca` <- function (x, choices = c(1, 2), display = c("sp", "wa", "cn"),
scaling = "species", type, xlim, ylim, const,
correlation = FALSE, hill = FALSE,
optimize = FALSE, arrows = FALSE,
spe.par = list(), sit.par = list(), con.par = list(),
bip.par = list(), cen.par = list(), reg.par = list(),
...)
Expand Down Expand Up @@ -77,12 +78,9 @@
abline(h = 0, lty = 3)
abline(v = 0, lty = 3)
## set up lists for graphical parameters
GlobalPar <- list("type" = type)
GlobalPar <- list("type" = type, "optimize" = optimize, "arrows" = arrows)
dots <- match.call(expand.dots = FALSE)$...
if (!is.null(dots)) {
## dots par optimize must be eval'ed to force it logical
if (!is.null(dots$optimize))
dots$optimize <- eval(dots$optimize)
GlobalPar <- modifyList(GlobalPar, dots)
}
## Default graphical parameters
Expand Down Expand Up @@ -152,5 +150,5 @@
if (!("CA" %in% names(x)))
stop(gettextf("%s is not a vegan rda object",
sQuote(deparse(substitute(x)))))
NextMethod("plot", x, ...)
NextMethod() # no need to pass ..., happens automagically
}
17 changes: 14 additions & 3 deletions man/plot.cca.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
\usage{
\method{plot}{cca}(x, choices = c(1, 2), display = c("sp", "wa", "cn"),
scaling = "species", type, xlim, ylim, const,
correlation = FALSE, hill = FALSE, spe.par = list(), sit.par =
list(), con.par = list(), bip.par = list(), cen.par = list(),
reg.par = list(), ...)
correlation = FALSE, hill = FALSE, optimize = FALSE, arrows = FALSE,
spe.par = list(), sit.par = list(), con.par = list(), bip.par = list(),
cen.par = list(), reg.par = list(), ...)
\method{text}{cca}(x, display = "sites", labels, choices = c(1, 2),
scaling = "species", arrow.mul, head.arrow = 0.05, select, const,
axis.bp = FALSE, correlation = FALSE, hill = FALSE, ...)
Expand Down Expand Up @@ -75,6 +75,17 @@
are used to select the corresponding negative scaling type; either
correlation-like scores or Hill's scaling for PCA/RDA and CA/CCA
respectively. See argument \code{scaling} for details.}

\item{optimize}{Optimize locations of text to reduce overlap and plot
point in the actual locations of the scores. Uses
\code{\link{ordipointlabel}}. }

\item{arrows}{Draw arrows from the origin. This will always be
\code{TRUE} for biplot and regression scores in constrained
ordination (\code{\link{cca}} etc.). Setting this \code{TRUE} will
draw arrows for any type of scores. This allows, e.g, using biplot
arrows for species. The arrow head will be at the value of scores,
and possible text is moved outwards.}

\item{spe.par, sit.par, con.par, bip.par, cen.par, reg.par}{
Lists of graphical parameters for species, sites, constraints (lc
Expand Down

0 comments on commit eb8b669

Please sign in to comment.