Re: [R-sig-eco] question for the R community : Plot RDA biplot without axis ?

2013-03-06 Thread Sarah Loboda
Hi :D
I finally had the chance to try your solutions. It was fast to modify
the code of the function and it worked!
I really appreciate your comments and your help. You are fast and clear !
I modified my code and I will never put white axes ever again ;)
Thank you very much.

2013/2/26 Jari Oksanen :
> Sarah,
>
> I added argument 'axis.bp' to text.cca and points.cca functions. To upgraded 
> functions can be found in http://vegan.r-forge.r-project.org/ (rev2452), and 
> will probably be included in the next minor release of vegan (2.0-7) 
> scheduled for March, 2013.
>
> You can also get the single files from R-Forge, or you can install devel 
> version of vegan with
>
> install.packages("vegan", repos="http://r-forge.r-project.org";)
>
> It will take a day at minimum to get the version packaged in R-Forge.
>
> Cheers, Jari Oksanen
>
> On 26 Feb 2013, at 3:49, Sarah Loboda wrote:
>
>> Hi,
>> Here's the reproducible example that I made with dune data. When you do the
>> 4 graphs, you can see that because of the text () function, there is an
>> axis on the right and values appear in the plots on the right side. I
>> understand that it is because of my text () function, but is there a way to
>> delete that axis in the text funtion? if not, is there another way to plot
>> my data on 4 panels without axis?
>>
>> I don't know what you mean by "body of vegan text.cca". You mean in the
>> vegan tutorial ?
>> I used col.axis because ann=FALSE as an argument in plot function does not
>> work and col.axis seems fine...
>>
>> Thank you very much for your time. I really appreciate your help :D
>>
>> library(vegan)
>> library(MASS)
>>
>> ### data
>> data(dune)
>> data(dune.env)
>>
>> ### Constrained ordination
>> dune.hel<-decostand(dune, "hellinger")
>> dune.cca <- cca(dune ~ A1 + Manure, data=dune.env)
>>
>> ### Plot with 4 panels
>> par(mfrow=c(2,2))
>> par(mar=c(0.3,0.3,0.3,0.3))
>>
>>
>> ### plot 1
>> plot(dune.cca, type = "n", scaling = 2, col.axis="white")
>> with(dune.env, points(dune.cca, display = "sites", scaling = 2, cex=1.3,
>> col=2))
>> ### When I add the next line, it adds env. variables as arrows but also
>> adds an axis on the right
>> text(dune.cca, display="bp", col=1, cex=1.1)
>>
>> ###plot 2
>> plot(dune.cca, type = "n", scaling = 2, col.axis="white", col="grey")
>> with(dune.env, points(dune.cca, display = "sites", scaling = 2, cex=1.3,
>> col=2))
>> text(dune.cca, display="bp", col=1, cex=1.1)
>>
>> ###plot 3
>> plot(dune.cca, type = "n", scaling = 2, col.axis="white")
>> with(dune.env, points(dune.cca, display = "sites", scaling = 2, cex=1.3,
>> col=2))
>> text(dune.cca, display="bp", col=1, cex=1.1)
>>
>> ###plot 4
>> plot(dune.cca, type = "n", scaling = 2, col.axis="white")
>> with(dune.env, points(dune.cca, display = "sites", scaling = 2, cex=1.3,
>> col=2))
>> text(dune.cca, display="bp", col=1, cex=1.1)
>>
>> 2013/2/25 Gavin Simpson 
>>
>>> On Mon, 2013-02-25 at 13:18 -0500, Sarah Loboda wrote:
 Hi,
 I have trouble to obtain the ordination graph I want. I want to have 4
>>> RDA
 biplot on the same page and I don't want to have (or I want to modify)
>>> the
 axis numbers. I want the marks on the axis without numbers to maximize
>>> the
 space for each RDA plot.
>>>
>>> A problem is the call to text() ( which calls text.cca() ). It doesn't
>>> pass on arguments to the underlying axis() calls and hence you can't do
>>> what you are trying to do with that function directly.
>>>
>>> Not sure why you want the axis to be white - that draws an axis so it
>>> will obscure anything drawn before it with white paint.
>>>
>>> The only solution at the moment will be to modify the vegan:::text.cca()
>>> function to change the two calls to axis() at the end of the function
>>> definition. I suspect you could just copy the body of vegan:::text.cca
>>> and put it into your own function, but I haven't tried it. If that fails
>>> due to namespace issues, then use assignInNamespace() to assign your
>>> function to the text.cca function in vegans namespace.
>>>
>>> See the relevant help pages on how to do this. I'm about to leave the
>>> office so I can't help further now, but if you have trouble email back
>>> to the list and I'll see about cooking up and example...
>>>
>>> All the best
>>>
>>> Gavin
>>>
 This seems like a simple task but I tried different approaches and
>>> coudn't
 figure out how to change my axis. This is my code :

 par(mfrow=c(2,2))
 par(mar=c(0.2,0.2,0.2,0.2))

 ### first RDA biplot
 with(arctic, levels(site))
 shapevec<- c(19,19,19,19,19,19,19,19,19,19,19,19,6,6,6,6,6,6,6,6,6,6,6,6)
 plot(spiders.rda.a, type = "n", scaling = 2, las=1, tcl=0.2,
 col.axis="white")
 with(spiders.env.a, points(spiders.rda.a, display = "sites",
scaling = 2, pch = shapevec, cex=1.3))
 text(spiders.rda.a, display="bp", cex=1.1, col.axis="white", ann=FALSE)
  it is when I run this line that my y ax

Re: [R-sig-eco] question for the R community : Plot RDA biplot without axis ?

2013-02-26 Thread Jari Oksanen
Sarah,

I added argument 'axis.bp' to text.cca and points.cca functions. To upgraded 
functions can be found in http://vegan.r-forge.r-project.org/ (rev2452), and 
will probably be included in the next minor release of vegan (2.0-7) scheduled 
for March, 2013.

You can also get the single files from R-Forge, or you can install devel 
version of vegan with

install.packages("vegan", repos="http://r-forge.r-project.org";)

It will take a day at minimum to get the version packaged in R-Forge.

Cheers, Jari Oksanen

On 26 Feb 2013, at 3:49, Sarah Loboda wrote:

> Hi,
> Here's the reproducible example that I made with dune data. When you do the
> 4 graphs, you can see that because of the text () function, there is an
> axis on the right and values appear in the plots on the right side. I
> understand that it is because of my text () function, but is there a way to
> delete that axis in the text funtion? if not, is there another way to plot
> my data on 4 panels without axis?
> 
> I don't know what you mean by "body of vegan text.cca". You mean in the
> vegan tutorial ?
> I used col.axis because ann=FALSE as an argument in plot function does not
> work and col.axis seems fine...
> 
> Thank you very much for your time. I really appreciate your help :D
> 
> library(vegan)
> library(MASS)
> 
> ### data
> data(dune)
> data(dune.env)
> 
> ### Constrained ordination
> dune.hel<-decostand(dune, "hellinger")
> dune.cca <- cca(dune ~ A1 + Manure, data=dune.env)
> 
> ### Plot with 4 panels
> par(mfrow=c(2,2))
> par(mar=c(0.3,0.3,0.3,0.3))
> 
> 
> ### plot 1
> plot(dune.cca, type = "n", scaling = 2, col.axis="white")
> with(dune.env, points(dune.cca, display = "sites", scaling = 2, cex=1.3,
> col=2))
> ### When I add the next line, it adds env. variables as arrows but also
> adds an axis on the right
> text(dune.cca, display="bp", col=1, cex=1.1)
> 
> ###plot 2
> plot(dune.cca, type = "n", scaling = 2, col.axis="white", col="grey")
> with(dune.env, points(dune.cca, display = "sites", scaling = 2, cex=1.3,
> col=2))
> text(dune.cca, display="bp", col=1, cex=1.1)
> 
> ###plot 3
> plot(dune.cca, type = "n", scaling = 2, col.axis="white")
> with(dune.env, points(dune.cca, display = "sites", scaling = 2, cex=1.3,
> col=2))
> text(dune.cca, display="bp", col=1, cex=1.1)
> 
> ###plot 4
> plot(dune.cca, type = "n", scaling = 2, col.axis="white")
> with(dune.env, points(dune.cca, display = "sites", scaling = 2, cex=1.3,
> col=2))
> text(dune.cca, display="bp", col=1, cex=1.1)
> 
> 2013/2/25 Gavin Simpson 
> 
>> On Mon, 2013-02-25 at 13:18 -0500, Sarah Loboda wrote:
>>> Hi,
>>> I have trouble to obtain the ordination graph I want. I want to have 4
>> RDA
>>> biplot on the same page and I don't want to have (or I want to modify)
>> the
>>> axis numbers. I want the marks on the axis without numbers to maximize
>> the
>>> space for each RDA plot.
>> 
>> A problem is the call to text() ( which calls text.cca() ). It doesn't
>> pass on arguments to the underlying axis() calls and hence you can't do
>> what you are trying to do with that function directly.
>> 
>> Not sure why you want the axis to be white - that draws an axis so it
>> will obscure anything drawn before it with white paint.
>> 
>> The only solution at the moment will be to modify the vegan:::text.cca()
>> function to change the two calls to axis() at the end of the function
>> definition. I suspect you could just copy the body of vegan:::text.cca
>> and put it into your own function, but I haven't tried it. If that fails
>> due to namespace issues, then use assignInNamespace() to assign your
>> function to the text.cca function in vegans namespace.
>> 
>> See the relevant help pages on how to do this. I'm about to leave the
>> office so I can't help further now, but if you have trouble email back
>> to the list and I'll see about cooking up and example...
>> 
>> All the best
>> 
>> Gavin
>> 
>>> This seems like a simple task but I tried different approaches and
>> coudn't
>>> figure out how to change my axis. This is my code :
>>> 
>>> par(mfrow=c(2,2))
>>> par(mar=c(0.2,0.2,0.2,0.2))
>>> 
>>> ### first RDA biplot
>>> with(arctic, levels(site))
>>> shapevec<- c(19,19,19,19,19,19,19,19,19,19,19,19,6,6,6,6,6,6,6,6,6,6,6,6)
>>> plot(spiders.rda.a, type = "n", scaling = 2, las=1, tcl=0.2,
>>> col.axis="white")
>>> with(spiders.env.a, points(spiders.rda.a, display = "sites",
>>>scaling = 2, pch = shapevec, cex=1.3))
>>> text(spiders.rda.a, display="bp", cex=1.1, col.axis="white", ann=FALSE)
>>>  it is when I run this line that my y axis appear on the right but I
>>> don't want to
>>> ### in yellow, this is what I tried to make it diseappear. To put those
>>> arguments in plot() doesn't change anything.
>>> 
>>> What should I had in the text part to make sure that the axis doesn't
>> show
>>> up?
>>> My intention is to plot my sites as dots without text and my arrows for
>>> environmental variables with the name of each variable. Any other ide

Re: [R-sig-eco] question for the R community : Plot RDA biplot without axis ?

2013-02-26 Thread Jari Oksanen
Sarah,

We indeed insist on drawing scale of arrows for text() and point() function of 
cca/rda/capscale. Currently the only way to avoid this is to edit the function. 
I'll see what to do with this.

One piece of advice: do not use col.axis = "white" which will draw white axes. 
The background of the graph is transparent but the plot is displayed on white 
canvas so that you cannot see white axes. The white axes are still, like you 
will see if you look at the graph against some other colour (which happens most 
easily if you copy the graph and display it in slides or in a poster with 
coloured background). The canonical way is to suppress axes:

plot(dune.cca, type="n", scaling = 2, axes = FALSE, xlab = "", ylab = "")

Here 'axes' suppress drawing axes and to be sure, xlab and ylab use zero-length 
strings "" so that axis labels are also suppressed. You can later use

box()

to frame the empty graph if needed.

Cheers, Jari Oksanen
On 26 Feb 2013, at 3:49, Sarah Loboda wrote:

> Hi,
> Here's the reproducible example that I made with dune data. When you do the
> 4 graphs, you can see that because of the text () function, there is an
> axis on the right and values appear in the plots on the right side. I
> understand that it is because of my text () function, but is there a way to
> delete that axis in the text funtion? if not, is there another way to plot
> my data on 4 panels without axis?
> 
> I don't know what you mean by "body of vegan text.cca". You mean in the
> vegan tutorial ?
> I used col.axis because ann=FALSE as an argument in plot function does not
> work and col.axis seems fine...
> 
> Thank you very much for your time. I really appreciate your help :D
> 
> library(vegan)
> library(MASS)
> 
> ### data
> data(dune)
> data(dune.env)
> 
> ### Constrained ordination
> dune.hel<-decostand(dune, "hellinger")
> dune.cca <- cca(dune ~ A1 + Manure, data=dune.env)
> 
> ### Plot with 4 panels
> par(mfrow=c(2,2))
> par(mar=c(0.3,0.3,0.3,0.3))
> 
> 
> ### plot 1
> plot(dune.cca, type = "n", scaling = 2, col.axis="white")
> with(dune.env, points(dune.cca, display = "sites", scaling = 2, cex=1.3,
> col=2))
> ### When I add the next line, it adds env. variables as arrows but also
> adds an axis on the right
> text(dune.cca, display="bp", col=1, cex=1.1)
> 
> ###plot 2
> plot(dune.cca, type = "n", scaling = 2, col.axis="white", col="grey")
> with(dune.env, points(dune.cca, display = "sites", scaling = 2, cex=1.3,
> col=2))
> text(dune.cca, display="bp", col=1, cex=1.1)
> 
> ###plot 3
> plot(dune.cca, type = "n", scaling = 2, col.axis="white")
> with(dune.env, points(dune.cca, display = "sites", scaling = 2, cex=1.3,
> col=2))
> text(dune.cca, display="bp", col=1, cex=1.1)
> 
> ###plot 4
> plot(dune.cca, type = "n", scaling = 2, col.axis="white")
> with(dune.env, points(dune.cca, display = "sites", scaling = 2, cex=1.3,
> col=2))
> text(dune.cca, display="bp", col=1, cex=1.1)
> 
> 2013/2/25 Gavin Simpson 
> 
>> On Mon, 2013-02-25 at 13:18 -0500, Sarah Loboda wrote:
>>> Hi,
>>> I have trouble to obtain the ordination graph I want. I want to have 4
>> RDA
>>> biplot on the same page and I don't want to have (or I want to modify)
>> the
>>> axis numbers. I want the marks on the axis without numbers to maximize
>> the
>>> space for each RDA plot.
>> 
>> A problem is the call to text() ( which calls text.cca() ). It doesn't
>> pass on arguments to the underlying axis() calls and hence you can't do
>> what you are trying to do with that function directly.
>> 
>> Not sure why you want the axis to be white - that draws an axis so it
>> will obscure anything drawn before it with white paint.
>> 
>> The only solution at the moment will be to modify the vegan:::text.cca()
>> function to change the two calls to axis() at the end of the function
>> definition. I suspect you could just copy the body of vegan:::text.cca
>> and put it into your own function, but I haven't tried it. If that fails
>> due to namespace issues, then use assignInNamespace() to assign your
>> function to the text.cca function in vegans namespace.
>> 
>> See the relevant help pages on how to do this. I'm about to leave the
>> office so I can't help further now, but if you have trouble email back
>> to the list and I'll see about cooking up and example...
>> 
>> All the best
>> 
>> Gavin
>> 
>>> This seems like a simple task but I tried different approaches and
>> coudn't
>>> figure out how to change my axis. This is my code :
>>> 
>>> par(mfrow=c(2,2))
>>> par(mar=c(0.2,0.2,0.2,0.2))
>>> 
>>> ### first RDA biplot
>>> with(arctic, levels(site))
>>> shapevec<- c(19,19,19,19,19,19,19,19,19,19,19,19,6,6,6,6,6,6,6,6,6,6,6,6)
>>> plot(spiders.rda.a, type = "n", scaling = 2, las=1, tcl=0.2,
>>> col.axis="white")
>>> with(spiders.env.a, points(spiders.rda.a, display = "sites",
>>>scaling = 2, pch = shapevec, cex=1.3))
>>> text(spiders.rda.a, display="bp", cex=1.1, col.axis="white", ann=FALSE)
>>>  it is when I run this lin

Re: [R-sig-eco] question for the R community : Plot RDA biplot without axis ?

2013-02-26 Thread Pierre Thiriet
Hi Sarah,

Here is Gavin's solution.

You have to modify the text.cca function. (at least) two ways:

# First
#without paranthèses after function name, you get the source codes
vegan:::text.cca
#then copy/paste this source codes, modify, save, and assign name space

#Second
# you can modify directly the function using  fixInNamespace()
fixInNamespace("text.cca",ns="vegan")  #this function opens a script editor
(in RStudio, I don't know in other config), you have to remove/modify lines
32 to 35.

#then you just have to run your codes, but just precise in your calls
"vegan:::text.cca" instead" of "text".

### data
data(dune)
data(dune.env)

### Constrained ordination
dune.hel<-decostand(dune, "hellinger")
dune.cca <- cca(dune ~ A1 + Manure, data=dune.env)

### Plot with 4 panels
par(mfrow=c(2,2))
par(mar=c(0.3,0.3,0.3,0.3))


### plot 1
plot(dune.cca, type = "n", scaling = 2, col.axis="white")
with(dune.env, points(dune.cca, display = "sites", scaling = 2, cex=1.3,
  col=2))
### When I add the next line, it adds env. variables as arrows but also
vegan:::text.cca(dune.cca, display="bp", col=1, cex=1.1)

###plot 2
plot(dune.cca, type = "n", scaling = 2, col.axis="white", col="grey")
with(dune.env, points(dune.cca, display = "sites", scaling = 2, cex=1.3,
  col=2))
vegan:::text.cca(dune.cca, display="bp", col=1, cex=1.1)

###plot 3
plot(dune.cca, type = "n", scaling = 2, col.axis="white")
with(dune.env, points(dune.cca, display = "sites", scaling = 2, cex=1.3,
  col=2))
vegan:::text.cca(dune.cca, display="bp", col=1, cex=1.1)

###plot 4
plot(dune.cca, type = "n", scaling = 2, col.axis="white")
with(dune.env, points(dune.cca, display = "sites", scaling = 2, cex=1.3,
  col=2))
vegan:::text.cca(dune.cca, display="bp", col=1, cex=1.1)



I hope it helps
Pierre

2013/2/26 Sarah Loboda 

> Hi,
> Here's the reproducible example that I made with dune data. When you do the
> 4 graphs, you can see that because of the text () function, there is an
> axis on the right and values appear in the plots on the right side. I
> understand that it is because of my text () function, but is there a way to
> delete that axis in the text funtion? if not, is there another way to plot
> my data on 4 panels without axis?
>
> I don't know what you mean by "body of vegan text.cca". You mean in the
> vegan tutorial ?
> I used col.axis because ann=FALSE as an argument in plot function does not
> work and col.axis seems fine...
>
> Thank you very much for your time. I really appreciate your help :D
>
> library(vegan)
> library(MASS)
>
> ### data
> data(dune)
> data(dune.env)
>
> ### Constrained ordination
> dune.hel<-decostand(dune, "hellinger")
> dune.cca <- cca(dune ~ A1 + Manure, data=dune.env)
>
> ### Plot with 4 panels
> par(mfrow=c(2,2))
> par(mar=c(0.3,0.3,0.3,0.3))
>
>
> ### plot 1
> plot(dune.cca, type = "n", scaling = 2, col.axis="white")
> with(dune.env, points(dune.cca, display = "sites", scaling = 2, cex=1.3,
> col=2))
> ### When I add the next line, it adds env. variables as arrows but also
> adds an axis on the right
> text(dune.cca, display="bp", col=1, cex=1.1)
>
> ###plot 2
> plot(dune.cca, type = "n", scaling = 2, col.axis="white", col="grey")
> with(dune.env, points(dune.cca, display = "sites", scaling = 2, cex=1.3,
> col=2))
> text(dune.cca, display="bp", col=1, cex=1.1)
>
> ###plot 3
> plot(dune.cca, type = "n", scaling = 2, col.axis="white")
> with(dune.env, points(dune.cca, display = "sites", scaling = 2, cex=1.3,
> col=2))
> text(dune.cca, display="bp", col=1, cex=1.1)
>
> ###plot 4
> plot(dune.cca, type = "n", scaling = 2, col.axis="white")
> with(dune.env, points(dune.cca, display = "sites", scaling = 2, cex=1.3,
> col=2))
> text(dune.cca, display="bp", col=1, cex=1.1)
>
> 2013/2/25 Gavin Simpson 
>
> > On Mon, 2013-02-25 at 13:18 -0500, Sarah Loboda wrote:
> > > Hi,
> > > I have trouble to obtain the ordination graph I want. I want to have 4
> > RDA
> > > biplot on the same page and I don't want to have (or I want to modify)
> > the
> > > axis numbers. I want the marks on the axis without numbers to maximize
> > the
> > > space for each RDA plot.
> >
> > A problem is the call to text() ( which calls text.cca() ). It doesn't
> > pass on arguments to the underlying axis() calls and hence you can't do
> > what you are trying to do with that function directly.
> >
> > Not sure why you want the axis to be white - that draws an axis so it
> > will obscure anything drawn before it with white paint.
> >
> > The only solution at the moment will be to modify the vegan:::text.cca()
> > function to change the two calls to axis() at the end of the function
> > definition. I suspect you could just copy the body of vegan:::text.cca
> > and put it into your own function, but I haven't tried it. If that fails
> > due to namespace issues, then use assignInNamespace() to assign your
> > function to the text.cca function in vegans namespace.
> >
> > See th

Re: [R-sig-eco] question for the R community : Plot RDA biplot without axis ?

2013-02-25 Thread Sarah Loboda
Hi,
Here's the reproducible example that I made with dune data. When you do the
4 graphs, you can see that because of the text () function, there is an
axis on the right and values appear in the plots on the right side. I
understand that it is because of my text () function, but is there a way to
delete that axis in the text funtion? if not, is there another way to plot
my data on 4 panels without axis?

I don't know what you mean by "body of vegan text.cca". You mean in the
vegan tutorial ?
I used col.axis because ann=FALSE as an argument in plot function does not
work and col.axis seems fine...

Thank you very much for your time. I really appreciate your help :D

library(vegan)
library(MASS)

### data
data(dune)
data(dune.env)

### Constrained ordination
dune.hel<-decostand(dune, "hellinger")
dune.cca <- cca(dune ~ A1 + Manure, data=dune.env)

### Plot with 4 panels
par(mfrow=c(2,2))
par(mar=c(0.3,0.3,0.3,0.3))


### plot 1
plot(dune.cca, type = "n", scaling = 2, col.axis="white")
with(dune.env, points(dune.cca, display = "sites", scaling = 2, cex=1.3,
col=2))
### When I add the next line, it adds env. variables as arrows but also
adds an axis on the right
text(dune.cca, display="bp", col=1, cex=1.1)

###plot 2
plot(dune.cca, type = "n", scaling = 2, col.axis="white", col="grey")
with(dune.env, points(dune.cca, display = "sites", scaling = 2, cex=1.3,
col=2))
text(dune.cca, display="bp", col=1, cex=1.1)

###plot 3
plot(dune.cca, type = "n", scaling = 2, col.axis="white")
with(dune.env, points(dune.cca, display = "sites", scaling = 2, cex=1.3,
col=2))
text(dune.cca, display="bp", col=1, cex=1.1)

###plot 4
plot(dune.cca, type = "n", scaling = 2, col.axis="white")
with(dune.env, points(dune.cca, display = "sites", scaling = 2, cex=1.3,
col=2))
text(dune.cca, display="bp", col=1, cex=1.1)

2013/2/25 Gavin Simpson 

> On Mon, 2013-02-25 at 13:18 -0500, Sarah Loboda wrote:
> > Hi,
> > I have trouble to obtain the ordination graph I want. I want to have 4
> RDA
> > biplot on the same page and I don't want to have (or I want to modify)
> the
> > axis numbers. I want the marks on the axis without numbers to maximize
> the
> > space for each RDA plot.
>
> A problem is the call to text() ( which calls text.cca() ). It doesn't
> pass on arguments to the underlying axis() calls and hence you can't do
> what you are trying to do with that function directly.
>
> Not sure why you want the axis to be white - that draws an axis so it
> will obscure anything drawn before it with white paint.
>
> The only solution at the moment will be to modify the vegan:::text.cca()
> function to change the two calls to axis() at the end of the function
> definition. I suspect you could just copy the body of vegan:::text.cca
> and put it into your own function, but I haven't tried it. If that fails
> due to namespace issues, then use assignInNamespace() to assign your
> function to the text.cca function in vegans namespace.
>
> See the relevant help pages on how to do this. I'm about to leave the
> office so I can't help further now, but if you have trouble email back
> to the list and I'll see about cooking up and example...
>
> All the best
>
> Gavin
>
> > This seems like a simple task but I tried different approaches and
> coudn't
> > figure out how to change my axis. This is my code :
> >
> > par(mfrow=c(2,2))
> > par(mar=c(0.2,0.2,0.2,0.2))
> >
> > ### first RDA biplot
> > with(arctic, levels(site))
> > shapevec<- c(19,19,19,19,19,19,19,19,19,19,19,19,6,6,6,6,6,6,6,6,6,6,6,6)
> > plot(spiders.rda.a, type = "n", scaling = 2, las=1, tcl=0.2,
> > col.axis="white")
> > with(spiders.env.a, points(spiders.rda.a, display = "sites",
> > scaling = 2, pch = shapevec, cex=1.3))
> > text(spiders.rda.a, display="bp", cex=1.1, col.axis="white", ann=FALSE)
> >  it is when I run this line that my y axis appear on the right but I
> > don't want to
> > ### in yellow, this is what I tried to make it diseappear. To put those
> > arguments in plot() doesn't change anything.
> >
> > What should I had in the text part to make sure that the axis doesn't
> show
> > up?
> > My intention is to plot my sites as dots without text and my arrows for
> > environmental variables with the name of each variable. Any other ideas
> on
> > rda plot will be greatly appreciated.
> > Thank you very much :D
> >
>
>
>
>


-- 
Sarah Loboda
MSc candidate, Entomology,
Department of Natural Resource Sciences
McGill University
*http://insectecology.mcgill.ca/*

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


Re: [R-sig-eco] question for the R community : Plot RDA biplot without axis ?

2013-02-25 Thread Gavin Simpson
On Mon, 2013-02-25 at 13:18 -0500, Sarah Loboda wrote:
> Hi,
> I have trouble to obtain the ordination graph I want. I want to have 4 RDA
> biplot on the same page and I don't want to have (or I want to modify) the
> axis numbers. I want the marks on the axis without numbers to maximize the
> space for each RDA plot.

A problem is the call to text() ( which calls text.cca() ). It doesn't
pass on arguments to the underlying axis() calls and hence you can't do
what you are trying to do with that function directly.

Not sure why you want the axis to be white - that draws an axis so it
will obscure anything drawn before it with white paint.

The only solution at the moment will be to modify the vegan:::text.cca()
function to change the two calls to axis() at the end of the function
definition. I suspect you could just copy the body of vegan:::text.cca
and put it into your own function, but I haven't tried it. If that fails
due to namespace issues, then use assignInNamespace() to assign your
function to the text.cca function in vegans namespace.

See the relevant help pages on how to do this. I'm about to leave the
office so I can't help further now, but if you have trouble email back
to the list and I'll see about cooking up and example...

All the best

Gavin

> This seems like a simple task but I tried different approaches and coudn't
> figure out how to change my axis. This is my code :
> 
> par(mfrow=c(2,2))
> par(mar=c(0.2,0.2,0.2,0.2))
> 
> ### first RDA biplot
> with(arctic, levels(site))
> shapevec<- c(19,19,19,19,19,19,19,19,19,19,19,19,6,6,6,6,6,6,6,6,6,6,6,6)
> plot(spiders.rda.a, type = "n", scaling = 2, las=1, tcl=0.2,
> col.axis="white")
> with(spiders.env.a, points(spiders.rda.a, display = "sites",
> scaling = 2, pch = shapevec, cex=1.3))
> text(spiders.rda.a, display="bp", cex=1.1, col.axis="white", ann=FALSE)
>  it is when I run this line that my y axis appear on the right but I
> don't want to
> ### in yellow, this is what I tried to make it diseappear. To put those
> arguments in plot() doesn't change anything.
> 
> What should I had in the text part to make sure that the axis doesn't show
> up?
> My intention is to plot my sites as dots without text and my arrows for
> environmental variables with the name of each variable. Any other ideas on
> rda plot will be greatly appreciated.
> Thank you very much :D
>

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology


[R-sig-eco] question for the R community : Plot RDA biplot without axis ?

2013-02-25 Thread Sarah Loboda
Hi,
I have trouble to obtain the ordination graph I want. I want to have 4 RDA
biplot on the same page and I don't want to have (or I want to modify) the
axis numbers. I want the marks on the axis without numbers to maximize the
space for each RDA plot.

This seems like a simple task but I tried different approaches and coudn't
figure out how to change my axis. This is my code :

par(mfrow=c(2,2))
par(mar=c(0.2,0.2,0.2,0.2))

### first RDA biplot
with(arctic, levels(site))
shapevec<- c(19,19,19,19,19,19,19,19,19,19,19,19,6,6,6,6,6,6,6,6,6,6,6,6)
plot(spiders.rda.a, type = "n", scaling = 2, las=1, tcl=0.2,
col.axis="white")
with(spiders.env.a, points(spiders.rda.a, display = "sites",
scaling = 2, pch = shapevec, cex=1.3))
text(spiders.rda.a, display="bp", cex=1.1, col.axis="white", ann=FALSE)
 it is when I run this line that my y axis appear on the right but I
don't want to
### in yellow, this is what I tried to make it diseappear. To put those
arguments in plot() doesn't change anything.

What should I had in the text part to make sure that the axis doesn't show
up?
My intention is to plot my sites as dots without text and my arrows for
environmental variables with the name of each variable. Any other ideas on
rda plot will be greatly appreciated.
Thank you very much :D

-- 
Sarah Loboda
MSc candidate, Entomology,
Department of Natural Resource Sciences
McGill University
*http://insectecology.mcgill.ca/*

[[alternative HTML version deleted]]

___
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology