-
Notifications
You must be signed in to change notification settings - Fork 98
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
plot.cca with optimize=TRUE and ordipointlabel in pipe #674
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Arg 'add = TRUE' needs tweaking: points are currently drawn only with 'add = FALSE'.
10% difference in graphic device dimensions triggers message. mar() is not checked, but it also influences plot size.
- try more times: now 64 (was 48) means that on average each position is tried 8 times (was 6). - a bit more detailed and stronger penalty: now against moving towards origin and against corners.
Triggers false warnings if using args for scores(), for instance.
Function text.ordiplot gains arg 'optimize' to call ordipointlabel to move text to reduce overlap, but put a point in the exact location. Function plot.cca uses text.ordiplot and gains the same ability. For instance, plot(cca(dune), spe.par = list(optimize=TRUE)).
This makes easier to have programmatic use of scores() when input parameter can be a pre-processed matrix instead of a complex list of matrices. Earlier ordipointabel(x, display=what) failed in text.ordiplot() when called from plot.cca().
- global arg (dot argument) 'optimize = T' must be eval'ed to make it logical TRUE (will be symbol initially) - add point defPointPar if pch not given by user - message on arrows looking strange with optimize=TRUE
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the second stage of new fully configurable
plot.cca
functions. This addsoptimize = TRUE
argument totext.ordiplot
and hence toplot.cca
as @gavinsimpson suggested in #657. With this,ordipointlabel
was made usable inplot
/ordiplot
pipe. The usage of plotting text over non-transparent label was expanded to more functions with argumentbg = <colour>
, usually viaordilabel
but directly implemented inordipointlabel
.The real changes were made in base routines used by
plot.cca
:ordipointlabel
can be used in anordiplot
pipe and can draw text on labels withbg = <colour>
. This optimizes any number of score types, although it defaults to two.text.ordiplot
gained new argumentoptimize = TRUE
that will callordipointlabel
for one set of scores.plot.cca
only sanitizes its input and will calltext.ordiplot
for new features.text.ordiplot
,ordilabel
andordipointlabel
(and the two latter are more configurable in pipe than viaplot.cca
).I made this as a PR instead of direct merge to allow comments and suggestions before merge, and to make these new capabilities more visible.