Skip to content

Commit

Permalink
Merge branch 'labelled-orditext'
Browse files Browse the repository at this point in the history
  • Loading branch information
jarioksa committed Jun 8, 2024
2 parents b26517a + 14d0b99 commit f7f68a0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 5 additions & 2 deletions R/text.ordiplot.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
`text.ordiplot` <-
function (x, what, labels, select, arrows = FALSE, length = 0.05,
arr.mul, ...)
arr.mul, bg, ...)
{
sco <- scores(x, what)
if (!missing(labels))
Expand All @@ -21,6 +21,9 @@
arrows(0, 0, sco[,1], sco[,2], length = length, ...)
sco <- ordiArrowTextXY(sco, rownames(sco), rescale = FALSE, ...)
}
text(sco, labels = rownames(sco), ...)
if (missing(bg))
text(sco, labels = rownames(sco), ...)
else
ordilabel(sco, labels = rownames(sco), fill = bg, ...)
invisible(x)
}
5 changes: 4 additions & 1 deletion man/ordiplot.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ordiplot(ord, choices = c(1, 2), type="points", display, xlim, ylim,
\method{points}{ordiplot}(x, what, select, arrows = FALSE,
length = 0.05, arr.mul, ...)
\method{text}{ordiplot}(x, what, labels, select, arrows = FALSE,
length = 0.05, arr.mul, ...)
length = 0.05, arr.mul, bg, ...)
\method{identify}{ordiplot}(x, what, labels, ...)
}

Expand Down Expand Up @@ -60,6 +60,9 @@ ordiplot(ord, choices = c(1, 2), type="points", display, xlim, ylim,
\code{arrows = TRUE}. The default is to automatically adjust arrow
lengths with \code{"biplot"} and \code{"regression"} scores and else
use scores directly.}
\item{bg}{Background colour for labels. If \code{bg} is set, the
labels are displayed with \code{\link{ordilabel}} instead of
\code{\link{text}}. }
\item{select}{Items to be displayed. This can either be a logical
vector which is \code{TRUE} for displayed items or a vector of indices
of displayed items.}
Expand Down

0 comments on commit f7f68a0

Please sign in to comment.