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

Gavin Simpson gavin.simpson at ucl.ac.uk
Mon Feb 25 23:48:54 CET 2013


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
>



More information about the R-sig-ecology mailing list