envfit vector labels with ordiplot3d

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

envfit vector labels with ordiplot3d

Briony
Hi R experts,

I'm looking for some help with plotting vectors from envfit in vegan, onto a 3d plot using ordiplot3d. So far I have

data.mds <- metaMDS(data, k=3,trace = FALSE)
vect_data<-envfit(data.mds,vegdata[,3:21],choices=1:3,permu=9999)
ordiplot3d(data.mds,envfit=vect_data)
ordixyplot(data.mds,pch=pts,envfit=vect_data)

(my data's not really called data, I thought it might be easier to communicate this way)

These display the vectors as arrows, but what I would really like is for the arrows to be labelled, like what comes up automatically in ordirgl or with a 2D ordiplot.

I've gone through the help and tried everything I can work out, but I must be missing something important, because nothing's worked so far. I would be happy to use ordixyplot and show a series of 2D plots, but I can't get labels on those arrows either.

Any pointers in the right direction would be gratefully received.
Briony
Reply | Threaded
Open this post in threaded view
|

Re: envfit vector labels with ordiplot3d

Jari Oksanen
Briony <brionynorton <at> gmail.com> writes:

>
> Hi R experts,
>
> I'm looking for some help with plotting vectors from envfit in vegan, onto a
> 3d plot using ordiplot3d. So far I have
>
> data.mds <- metaMDS(data, k=3,trace = FALSE)
> vect_data<-envfit(data.mds,vegdata[,3:21],choices=1:3,permu=9999)
> ordiplot3d(data.mds,envfit=vect_data)
> ordixyplot(data.mds,pch=pts,envfit=vect_data)
>
> (my data's not really called data, I thought it might be easier to
> communicate this way)
>
> These display the vectors as arrows, but what I would really like is for the
> arrows to be labelled, like what comes up automatically in ordirgl or with a
> 2D ordiplot.
>
> I've gone through the help and tried everything I can work out, but I must
> be missing something important, because nothing's worked so far. I would be
> happy to use ordixyplot and show a series of 2D plots, but I can't get
> labels on those arrows either.
>
> Any pointers in the right direction would be gratefully received.
> Briony

Briony,

There really is no way to do this automatically, but if someone fixes the
functions, we are happy to incorporate those changes in vegan.

You may be able to achieve something like that with ordiplot3d, but I am
not sure it looks completely satisfactory. Function ordiplot3d returns
invisibly the plotting object which contains, among other items. the
coordinates of arrow heads in the  flattened graph. So this could work:

pl <- ordiplot3d(data.mds,envfit=vect_data)
ordilabel(pl$arrows)

Function ordiplot3d uses scatterplot3d, and it returns also all
scatterplot3d items, like functions xyz.converter and points3d that
can be used for tuning labels.

With ordixyplot I can see no other choice than that you edit the
function and preferably contribute your edited function to vegan
(and will be credited with the function help).

Cheers, Jari Oksanen

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: envfit vector labels with ordiplot3d

Briony
Thank you very much for the suggestion. And while I'm here, thank you for vegan and the documentation that goes with it.

I tried ordilabel(pl$arrows) but the labels only seem to be in two dimensions.

I'm not a skilled enough user of R to edit the ordixyplot function - so I'll pass on that invitation to anyone else who reads this thread?

Thanks again,
Briony
Reply | Threaded
Open this post in threaded view
|

Re: envfit vector labels with ordiplot3d

Uwe Ligges-3
Please quote the prior thread, otherwise readers of this mailing list
will not get the context.

Uwe Ligges




On 12.09.2011 01:41, Briony wrote:

> Thank you very much for the suggestion. And while I'm here, thank you for
> vegan and the documentation that goes with it.
>
> I tried ordilabel(pl$arrows) but the labels only seem to be in two
> dimensions.
>
> I'm not a skilled enough user of R to edit the ordixyplot function - so I'll
> pass on that invitation to anyone else who reads this thread?
>
> Thanks again,
> Briony
>
> --
> View this message in context: http://r.789695.n4.nabble.com/envfit-vector-labels-with-ordiplot3d-tp3800669p3806001.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: envfit vector labels with ordiplot3d

Briony
In reply to this post by Jari Oksanen
Thank you very much for the suggestion. And while I'm here, thank you for vegan and the documentation that goes with it.

>Function ordiplot3d uses scatterplot3d, and it returns also all
>scatterplot3d items, like functions xyz.converter and points3d that
>can be used for tuning labels.

I tried ordilabel(pl$arrows) but the labels only seem to be in two dimensions.

>With ordixyplot I can see no other choice than that you edit the
>function and preferably contribute your edited function to vegan
>(and will be credited with the function help).

I'm not a skilled enough user of R to edit the ordixyplot function - so I'll pass on that invitation to anyone else who reads this thread?

Thanks again,
Briony

Briony <brionynorton <at> gmail.com> writes:

>
> Hi R experts,
>
> I'm looking for some help with plotting vectors from envfit in vegan, onto a
> 3d plot using ordiplot3d. So far I have
>
> data.mds <- metaMDS(data, k=3,trace = FALSE)
> vect_data<-envfit(data.mds,vegdata[,3:21],choices=1:3,permu=9999)
> ordiplot3d(data.mds,envfit=vect_data)
> ordixyplot(data.mds,pch=pts,envfit=vect_data)
>
> (my data's not really called data, I thought it might be easier to
> communicate this way)
>
> These display the vectors as arrows, but what I would really like is for the
> arrows to be labelled, like what comes up automatically in ordirgl or with a
> 2D ordiplot.
>
> I've gone through the help and tried everything I can work out, but I must
> be missing something important, because nothing's worked so far. I would be
> happy to use ordixyplot and show a series of 2D plots, but I can't get
> labels on those arrows either.
>
> Any pointers in the right direction would be gratefully received.
> Briony

Briony,

There really is no way to do this automatically, but if someone fixes the
functions, we are happy to incorporate those changes in vegan.

You may be able to achieve something like that with ordiplot3d, but I am
not sure it looks completely satisfactory. Function ordiplot3d returns
invisibly the plotting object which contains, among other items. the
coordinates of arrow heads in the  flattened graph. So this could work:

pl <- ordiplot3d(data.mds,envfit=vect_data)
ordilabel(pl$arrows)

Function ordiplot3d uses scatterplot3d, and it returns also all
scatterplot3d items, like functions xyz.converter and points3d that
can be used for tuning labels.

With ordixyplot I can see no other choice than that you edit the
function and preferably contribute your edited function to vegan
(and will be credited with the function help).

Cheers, Jari Oksanen

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: envfit vector labels with ordiplot3d

Gavin Simpson
On Mon, 2011-09-12 at 03:24 -0700, Briony wrote:
> Thank you very much for the suggestion. And while I'm here, thank you for
> vegan and the documentation that goes with it.
>
> >Function ordiplot3d uses scatterplot3d, and it returns also all
> >scatterplot3d items, like functions xyz.converter and points3d that
> >can be used for tuning labels.
>
> I tried ordilabel(pl$arrows) but the labels only seem to be in two
> dimensions.

It *really* does help to read the documentation for functions. Like most
of the functions in vegan that extract information from ordinations,
ordilabel() extracts information for "axes" 1 and 2 only, by default.

Does

ordilabel(pl$arrows, choices = 1:3)

work for you?

G

> >With ordixyplot I can see no other choice than that you edit the
> >function and preferably contribute your edited function to vegan
> >(and will be credited with the function help).
>
> I'm not a skilled enough user of R to edit the ordixyplot function - so I'll
> pass on that invitation to anyone else who reads this thread?
>
> Thanks again,
> Briony
>
> Briony <brionynorton <at> gmail.com> writes:
>
> >
> > Hi R experts,
> >
> > I'm looking for some help with plotting vectors from envfit in vegan, onto
> > a
> > 3d plot using ordiplot3d. So far I have
> >
> > data.mds <- metaMDS(data, k=3,trace = FALSE)
> > vect_data<-envfit(data.mds,vegdata[,3:21],choices=1:3,permu=9999)
> > ordiplot3d(data.mds,envfit=vect_data)
> > ordixyplot(data.mds,pch=pts,envfit=vect_data)
> >
> > (my data's not really called data, I thought it might be easier to
> > communicate this way)
> >
> > These display the vectors as arrows, but what I would really like is for
> > the
> > arrows to be labelled, like what comes up automatically in ordirgl or with
> > a
> > 2D ordiplot.
> >
> > I've gone through the help and tried everything I can work out, but I must
> > be missing something important, because nothing's worked so far. I would
> > be
> > happy to use ordixyplot and show a series of 2D plots, but I can't get
> > labels on those arrows either.
> >
> > Any pointers in the right direction would be gratefully received.
> > Briony
>
> Briony,
>
> There really is no way to do this automatically, but if someone fixes the
> functions, we are happy to incorporate those changes in vegan.
>
> You may be able to achieve something like that with ordiplot3d, but I am
> not sure it looks completely satisfactory. Function ordiplot3d returns
> invisibly the plotting object which contains, among other items. the
> coordinates of arrow heads in the  flattened graph. So this could work:
>
> pl <- ordiplot3d(data.mds,envfit=vect_data)
> ordilabel(pl$arrows)
>
> Function ordiplot3d uses scatterplot3d, and it returns also all
> scatterplot3d items, like functions xyz.converter and points3d that
> can be used for tuning labels.
>
> With ordixyplot I can see no other choice than that you edit the
> function and preferably contribute your edited function to vegan
> (and will be credited with the function help).
>
> Cheers, Jari Oksanen
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
> --
> View this message in context: http://r.789695.n4.nabble.com/envfit-vector-labels-with-ordiplot3d-tp3800669p3807015.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

--
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Dr. Gavin Simpson             [t] +44 (0)20 7679 0522
 ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
 Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: envfit vector labels with ordiplot3d

Briony
This post has NOT been accepted by the mailing list yet.
It *really* does help to read the documentation for functions. Like most 
of the functions in vegan that extract information from ordinations, 
ordilabel() extracts information for "axes" 1 and 2 only, by default. 

Does 

ordilabel(pl$arrows, choices = 1:3) 

work for you? 


Unfortunately that didn't work - it returned an error (Error in scores.default(x, choices = choices, display = display, ...) : subscript out of bounds). The ordilabel help says "ordilabel(x, display, labels, choices = c(1, 2)...", I'm not sure if this is why that error's arisen? I'll see if I can work something out. Thanks for your suggestion, it's very much appreciated.
Briony

On Tue, Sep 13, 2011 at 2:53 AM, Gavin Simpson [via R] <[hidden email]> wrote:
On Mon, 2011-09-12 at 03:24 -0700, Briony wrote:
> Thank you very much for the suggestion. And while I'm here, thank you for
> vegan and the documentation that goes with it.
>
> >Function ordiplot3d uses scatterplot3d, and it returns also all
> >scatterplot3d items, like functions xyz.converter and points3d that
> >can be used for tuning labels.
>
> I tried ordilabel(pl$arrows) but the labels only seem to be in two
> dimensions.

It *really* does help to read the documentation for functions. Like most
of the functions in vegan that extract information from ordinations,
ordilabel() extracts information for "axes" 1 and 2 only, by default.

Does

ordilabel(pl$arrows, choices = 1:3)

work for you?

G

> >With ordixyplot I can see no other choice than that you edit the
> >function and preferably contribute your edited function to vegan
> >(and will be credited with the function help).
>
> I'm not a skilled enough user of R to edit the ordixyplot function - so I'll
> pass on that invitation to anyone else who reads this thread?
>
> Thanks again,
> Briony
>
> Briony <brionynorton <at> gmail.com> writes:
>
> >
> > Hi R experts,
> >
> > I'm looking for some help with plotting vectors from envfit in vegan, onto
> > a
> > 3d plot using ordiplot3d. So far I have
> >
> > data.mds <- metaMDS(data, k=3,trace = FALSE)
> > vect_data<-envfit(data.mds,vegdata[,3:21],choices=1:3,permu=9999)
> > ordiplot3d(data.mds,envfit=vect_data)
> > ordixyplot(data.mds,pch=pts,envfit=vect_data)
> >
> > (my data's not really called data, I thought it might be easier to
> > communicate this way)
> >
> > These display the vectors as arrows, but what I would really like is for
> > the
> > arrows to be labelled, like what comes up automatically in ordirgl or with
> > a
> > 2D ordiplot.
> >
> > I've gone through the help and tried everything I can work out, but I must
> > be missing something important, because nothing's worked so far. I would
> > be
> > happy to use ordixyplot and show a series of 2D plots, but I can't get
> > labels on those arrows either.
> >
> > Any pointers in the right direction would be gratefully received.
> > Briony
>
> Briony,
>
> There really is no way to do this automatically, but if someone fixes the
> functions, we are happy to incorporate those changes in vegan.
>
> You may be able to achieve something like that with ordiplot3d, but I am
> not sure it looks completely satisfactory. Function ordiplot3d returns
> invisibly the plotting object which contains, among other items. the
> coordinates of arrow heads in the  flattened graph. So this could work:
>
> pl <- ordiplot3d(data.mds,envfit=vect_data)
> ordilabel(pl$arrows)
>
> Function ordiplot3d uses scatterplot3d, and it returns also all
> scatterplot3d items, like functions xyz.converter and points3d that
> can be used for tuning labels.
>
> With ordixyplot I can see no other choice than that you edit the
> function and preferably contribute your edited function to vegan
> (and will be credited with the function help).
>
> Cheers, Jari Oksanen
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
> --
> View this message in context: http://r.789695.n4.nabble.com/envfit-vector-labels-with-ordiplot3d-tp3800669p3807015.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

--
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Dr. Gavin Simpson             [t] <a href="tel:%2B44%20%280%2920%207679%200522" value="+442076790522" target="_blank">+44 (0)20 7679 0522
 ECRC, UCL Geography,          [f] <a href="tel:%2B44%20%280%2920%207679%200565" value="+442076790565" target="_blank">+44 (0)20 7679 0565
 Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



If you reply to this email, your message will be added to the discussion below:
http://r.789695.n4.nabble.com/envfit-vector-labels-with-ordiplot3d-tp3800669p3807984.html
To unsubscribe from envfit vector labels with ordiplot3d, click here.

Reply | Threaded
Open this post in threaded view
|

Re: envfit vector labels with ordiplot3d

Gavin Simpson
In reply to this post by Gavin Simpson
On Tue, 2011-09-13 at 05:18 -0700, Briony wrote:
> It *really* does help to read the documentation for functions. Like most
> of the functions in vegan that extract information from ordinations,
> ordilabel() extracts information for "axes" 1 and 2 only, by default.

It also helps if I read the docs too!

The reason this was in 2d and will always be in 2d is that that is how
scatterplot3d works - the arrow head in 2d on the device has been placed
at the 2d translation of the original 3d coordinates.

It might help to push the label away from the arrow head a little bit:

ordilabel(pl$arrows * 1.075)

will push the label 7.5% away from the arrow head.

It seems that that is the best we can currently do with vegan.

When you say that this is not what you wanted, what did you want to
achieve?

G

> Does
>
> ordilabel(pl$arrows, choices = 1:3)
>
> work for you?
>
> G
>
> Thanks for the suggestion. Unfortunately that didn't work - it returned an
> error (Error in scores.default(x, choices = choices, display = display, ...)
> : subscript out of bounds). The ordilabel help says "ordilabel(x, display,
> labels, choices = c(1, 2)..." which seems to suggest the function might not
> allow a third axis at the moment?
> Cheers,
> Briony
>
>
> On Tue, Sep 13, 2011 at 2:53 AM, Gavin Simpson [via R] <
> [hidden email]> wrote:
>
> > On Mon, 2011-09-12 at 03:24 -0700, Briony wrote:
> > > Thank you very much for the suggestion. And while I'm here, thank you for
> >
> > > vegan and the documentation that goes with it.
> > >
> > > >Function ordiplot3d uses scatterplot3d, and it returns also all
> > > >scatterplot3d items, like functions xyz.converter and points3d that
> > > >can be used for tuning labels.
> > >
> > > I tried ordilabel(pl$arrows) but the labels only seem to be in two
> > > dimensions.
> >
> > It *really* does help to read the documentation for functions. Like most
> > of the functions in vegan that extract information from ordinations,
> > ordilabel() extracts information for "axes" 1 and 2 only, by default.
> >
> > Does
> >
> > ordilabel(pl$arrows, choices = 1:3)
> >
> > work for you?
> >
> > G
> >
> > > >With ordixyplot I can see no other choice than that you edit the
> > > >function and preferably contribute your edited function to vegan
> > > >(and will be credited with the function help).
> > >
> > > I'm not a skilled enough user of R to edit the ordixyplot function - so
> > I'll
> > > pass on that invitation to anyone else who reads this thread?
> > >
> > > Thanks again,
> > > Briony
> > >
> > > Briony <brionynorton <at> gmail.com> writes:
> > >
> > > >
> > > > Hi R experts,
> > > >
> > > > I'm looking for some help with plotting vectors from envfit in vegan,
> > onto
> > > > a
> > > > 3d plot using ordiplot3d. So far I have
> > > >
> > > > data.mds <- metaMDS(data, k=3,trace = FALSE)
> > > > vect_data<-envfit(data.mds,vegdata[,3:21],choices=1:3,permu=9999)
> > > > ordiplot3d(data.mds,envfit=vect_data)
> > > > ordixyplot(data.mds,pch=pts,envfit=vect_data)
> > > >
> > > > (my data's not really called data, I thought it might be easier to
> > > > communicate this way)
> > > >
> > > > These display the vectors as arrows, but what I would really like is
> > for
> > > > the
> > > > arrows to be labelled, like what comes up automatically in ordirgl or
> > with
> > > > a
> > > > 2D ordiplot.
> > > >
> > > > I've gone through the help and tried everything I can work out, but I
> > must
> > > > be missing something important, because nothing's worked so far. I
> > would
> > > > be
> > > > happy to use ordixyplot and show a series of 2D plots, but I can't get
> > > > labels on those arrows either.
> > > >
> > > > Any pointers in the right direction would be gratefully received.
> > > > Briony
> > >
> > > Briony,
> > >
> > > There really is no way to do this automatically, but if someone fixes the
> >
> > > functions, we are happy to incorporate those changes in vegan.
> > >
> > > You may be able to achieve something like that with ordiplot3d, but I am
> > > not sure it looks completely satisfactory. Function ordiplot3d returns
> > > invisibly the plotting object which contains, among other items. the
> > > coordinates of arrow heads in the  flattened graph. So this could work:
> > >
> > > pl <- ordiplot3d(data.mds,envfit=vect_data)
> > > ordilabel(pl$arrows)
> > >
> > > Function ordiplot3d uses scatterplot3d, and it returns also all
> > > scatterplot3d items, like functions xyz.converter and points3d that
> > > can be used for tuning labels.
> > >
> > > With ordixyplot I can see no other choice than that you edit the
> > > function and preferably contribute your edited function to vegan
> > > (and will be credited with the function help).
> > >
> > > Cheers, Jari Oksanen
> > >
> > > ______________________________________________
> > > [hidden email] mailing list
> > > https://stat.ethz.ch/mailman/listinfo/r-help
> > > PLEASE do read the posting guide
> > http://www.R-project.org/posting-guide.html
> > > and provide commented, minimal, self-contained, reproducible code.
> > >
> > > --
> > > View this message in context:
> > http://r.789695.n4.nabble.com/envfit-vector-labels-with-ordiplot3d-tp3800669p3807015.html
> > > Sent from the R help mailing list archive at Nabble.com.
> > >
> > > ______________________________________________
> > > [hidden email] <http://user/SendEmail.jtp?type=node&node=3807984&i=0>mailing list
> > > https://stat.ethz.ch/mailman/listinfo/r-help
> > > PLEASE do read the posting guide
> > http://www.R-project.org/posting-guide.html
> > > and provide commented, minimal, self-contained, reproducible code.
> >
> > --
> > %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
> >  Dr. Gavin Simpson             [t] +44 (0)20 7679 0522
> >  ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
> >  Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
> >  Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
> >  UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
> > %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
> >
> > ______________________________________________
> > [hidden email] <http://user/SendEmail.jtp?type=node&node=3807984&i=1>mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> > http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
> >
> > ------------------------------
> >  If you reply to this email, your message will be added to the discussion
> > below:
> >
> > http://r.789695.n4.nabble.com/envfit-vector-labels-with-ordiplot3d-tp3800669p3807984.html
> >  To unsubscribe from envfit vector labels with ordiplot3d, click here<
> >
> >
>
>
> --
> View this message in context:
http://r.789695.n4.nabble.com/envfit-vector-labels-with-ordiplot3d-tp3800669p3809900.html
> Sent from the R help mailing list archive at Nabble.com.
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

--
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Dr. Gavin Simpson             [t] +44 (0)20 7679 0522
 ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
 Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: envfit vector labels with ordiplot3d

Briony
Hi Gavin,

It might help to push the label away from the arrow head a little bit: 

ordilabel(pl$arrows * 1.075) 


This seems to do a pretty good job. 

will push the label 7.5% away from the arrow head. 

It seems that that is the best we can currently do with vegan. 

When you say that this is not what you wanted, what did you want to 
achieve? 


I was hoping to have the option of displaying the vectors on a 3d plot on a page so you can see how they relate to the points from the community data. While ordirgl is great, it's not so good for displaying on a 2d surface as far as I can tell. 


Cheers,
Briony


On Wed, Sep 14, 2011 at 5:44 AM, Gavin Simpson [via R] <[hidden email]> wrote:
On Tue, 2011-09-13 at 05:18 -0700, Briony wrote:
> It *really* does help to read the documentation for functions. Like most
> of the functions in vegan that extract information from ordinations,
> ordilabel() extracts information for "axes" 1 and 2 only, by default.

It also helps if I read the docs too!

The reason this was in 2d and will always be in 2d is that that is how
scatterplot3d works - the arrow head in 2d on the device has been placed
at the 2d translation of the original 3d coordinates.

It might help to push the label away from the arrow head a little bit:

ordilabel(pl$arrows * 1.075)

will push the label 7.5% away from the arrow head.

It seems that that is the best we can currently do with vegan.

When you say that this is not what you wanted, what did you want to
achieve?

G

> Does
>
> ordilabel(pl$arrows, choices = 1:3)
>
> work for you?
>
> G
>
> Thanks for the suggestion. Unfortunately that didn't work - it returned an
> error (Error in scores.default(x, choices = choices, display = display, ...)
> : subscript out of bounds). The ordilabel help says "ordilabel(x, display,
> labels, choices = c(1, 2)..." which seems to suggest the function might not
> allow a third axis at the moment?
> Cheers,
> Briony
>
>
> On Tue, Sep 13, 2011 at 2:53 AM, Gavin Simpson [via R] <
> [hidden email]> wrote:

>
> > On Mon, 2011-09-12 at 03:24 -0700, Briony wrote:
> > > Thank you very much for the suggestion. And while I'm here, thank you for
> >
> > > vegan and the documentation that goes with it.
> > >
> > > >Function ordiplot3d uses scatterplot3d, and it returns also all
> > > >scatterplot3d items, like functions xyz.converter and points3d that
> > > >can be used for tuning labels.
> > >
> > > I tried ordilabel(pl$arrows) but the labels only seem to be in two
> > > dimensions.
> >
> > It *really* does help to read the documentation for functions. Like most
> > of the functions in vegan that extract information from ordinations,
> > ordilabel() extracts information for "axes" 1 and 2 only, by default.
> >
> > Does
> >
> > ordilabel(pl$arrows, choices = 1:3)
> >
> > work for you?
> >
> > G
> >
> > > >With ordixyplot I can see no other choice than that you edit the
> > > >function and preferably contribute your edited function to vegan
> > > >(and will be credited with the function help).
> > >
> > > I'm not a skilled enough user of R to edit the ordixyplot function - so
> > I'll
> > > pass on that invitation to anyone else who reads this thread?
> > >
> > > Thanks again,
> > > Briony
> > >
> > > Briony <brionynorton <at> gmail.com> writes:
> > >
> > > >
> > > > Hi R experts,
> > > >
> > > > I'm looking for some help with plotting vectors from envfit in vegan,
> > onto
> > > > a
> > > > 3d plot using ordiplot3d. So far I have
> > > >
> > > > data.mds <- metaMDS(data, k=3,trace = FALSE)
> > > > vect_data<-envfit(data.mds,vegdata[,3:21],choices=1:3,permu=9999)
> > > > ordiplot3d(data.mds,envfit=vect_data)
> > > > ordixyplot(data.mds,pch=pts,envfit=vect_data)
> > > >
> > > > (my data's not really called data, I thought it might be easier to
> > > > communicate this way)
> > > >
> > > > These display the vectors as arrows, but what I would really like is
> > for
> > > > the
> > > > arrows to be labelled, like what comes up automatically in ordirgl or
> > with
> > > > a
> > > > 2D ordiplot.
> > > >
> > > > I've gone through the help and tried everything I can work out, but I
> > must
> > > > be missing something important, because nothing's worked so far. I
> > would
> > > > be
> > > > happy to use ordixyplot and show a series of 2D plots, but I can't get
> > > > labels on those arrows either.
> > > >
> > > > Any pointers in the right direction would be gratefully received.
> > > > Briony
> > >
> > > Briony,
> > >
> > > There really is no way to do this automatically, but if someone fixes the
> >
> > > functions, we are happy to incorporate those changes in vegan.
> > >
> > > You may be able to achieve something like that with ordiplot3d, but I am
> > > not sure it looks completely satisfactory. Function ordiplot3d returns
> > > invisibly the plotting object which contains, among other items. the
> > > coordinates of arrow heads in the  flattened graph. So this could work:
> > >
> > > pl <- ordiplot3d(data.mds,envfit=vect_data)
> > > ordilabel(pl$arrows)
> > >
> > > Function ordiplot3d uses scatterplot3d, and it returns also all
> > > scatterplot3d items, like functions xyz.converter and points3d that
> > > can be used for tuning labels.
> > >
> > > With ordixyplot I can see no other choice than that you edit the
> > > function and preferably contribute your edited function to vegan
> > > (and will be credited with the function help).
> > >
> > > Cheers, Jari Oksanen
> > >
> > > ______________________________________________
> > > [hidden email] mailing list
> > > https://stat.ethz.ch/mailman/listinfo/r-help
> > > PLEASE do read the posting guide
> > http://www.R-project.org/posting-guide.html
> > > and provide commented, minimal, self-contained, reproducible code.
> > >
> > > --
> > > View this message in context:
> > http://r.789695.n4.nabble.com/envfit-vector-labels-with-ordiplot3d-tp3800669p3807015.html
> > > Sent from the R help mailing list archive at Nabble.com.
> > >
> > > ______________________________________________
> > > [hidden email] <http://user/SendEmail.jtp?type=node&node=3807984&i=0>mailing list
> > > https://stat.ethz.ch/mailman/listinfo/r-help

> > > PLEASE do read the posting guide
> > http://www.R-project.org/posting-guide.html
> > > and provide commented, minimal, self-contained, reproducible code.
> >
> > --
> > %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
> >  Dr. Gavin Simpson             [t] <a href="tel:%2B44%20%280%2920%207679%200522" value="+442076790522" target="_blank">+44 (0)20 7679 0522
> >  ECRC, UCL Geography,          [f] <a href="tel:%2B44%20%280%2920%207679%200565" value="+442076790565" target="_blank">+44 (0)20 7679 0565
> >  Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
> >  Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
> >  UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
> > %~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
> >
> > ______________________________________________
> > [hidden email] <http://user/SendEmail.jtp?type=node&node=3807984&i=1>mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-help
> > PLEASE do read the posting guide
> > http://www.R-project.org/posting-guide.html
> > and provide commented, minimal, self-contained, reproducible code.
> >
> >
> > ------------------------------
> >  If you reply to this email, your message will be added to the discussion

> > below:
> >
> >

> >
> >
>
>
> --
> View this message in context:
http://r.789695.n4.nabble.com/envfit-vector-labels-with-ordiplot3d-tp3800669p3809900.html

> Sent from the R help mailing list archive at Nabble.com.
> [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

--
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Dr. Gavin Simpson             [t] +44 (0)20 7679 0522
 ECRC, UCL Geography,          [f] +44 (0)20 7679 0565
 Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/
 UK. WC1E 6BT.                 [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%

______________________________________________
[hidden email] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.



If you reply to this email, your message will be added to the discussion below:
http://r.789695.n4.nabble.com/envfit-vector-labels-with-ordiplot3d-tp3800669p3810985.html
To unsubscribe from envfit vector labels with ordiplot3d, click here.