Skip to content
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

bug in plot.envfit #315

Closed
XavierTB opened this issue May 28, 2019 · 1 comment
Closed

bug in plot.envfit #315

XavierTB opened this issue May 28, 2019 · 1 comment
Labels
bug

Comments

@XavierTB
Copy link

@XavierTB XavierTB commented May 28, 2019

Hi, I came across a possible bug in vegan 2.5-4 with plot.envfit
When I plot an envfit object with the at=c(x,y) argument, the vectors' origin is displaced by x,y, but the labels are displaced by 2x,2Y, as in the following instance:

image

generated with:

plot(env)
plot(env,at=c(1,-2))

I had a look at plot.envfit, I think the offending line is:

 vtext <- sweep(vtext, 2, at, "+")

because vtext is already at the new location from the previous ordiArrowtextXY command

Best

@jarioksa jarioksa added the bug label Jun 2, 2019
jarioksa added a commit that referenced this issue Jun 2, 2019
The positions are not quite correct, because ordiArrowText does not
know the centroid of arrows when not at=c(0,0) and may move text
to the wrong direction.

Reported as issue #315 in github, and this fix was suggested there
by XavierTB
jarioksa added a commit that referenced this issue Jun 3, 2019
@jarioksa
Copy link
Contributor

@jarioksa jarioksa commented Jun 3, 2019

Thanks for reporting this. It is now fixed following your suggestion (plus some fine tuning).

@jarioksa jarioksa closed this Jun 3, 2019
jarioksa added a commit that referenced this issue Jun 3, 2019
The positions are not quite correct, because ordiArrowText does not
know the centroid of arrows when not at=c(0,0) and may move text
to the wrong direction.

Reported as issue #315 in github, and this fix was suggested there
by XavierTB

(cherry picked from commit 4086896)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.