Graphing forum
This forum is for questions related to graphing in R.
Hi,
I would like to change the size of my axis in order to make all my data fit in the graphic, I am using the function plot() for drawing an species acccumulation curve. Thanks in advance.
G.R.
Use xlim=c(lower,upper).
E.g., if you want your xaxis to go from zero to 100:
yourplot <- plot(x=x,y=y,xlim=c(0,100))
I have carried out several mantel tests on some genetic data in 'R' and would like to plot the results in the form of a histogam of the distribution - and preferably one that shows the critical 'r' value.
The tail end of my procedure is shown below - I just need help to dig out an instruction to follow on from this result.
6 4.000000 4.582576 4.123106 4.000000 4.472136 0.000000 2.236068
7 4.358899 5.099020 4.690416 4.358899 4.582576 2.236068 0.000000
> mantel.rtest(sample.dists, cat.dists, nrepet = 9999)
Monte-Carlo test
Observation: 0.4431225
Call: mantel.rtest(m1 = sample.dists, m2 = cat.dists, nrepet = 9999)
Based on 9999 replicates
Simulated p-value: 1e-04

Hi,
I am trying to plot 2 time series which have different x- and y- scales. The first time series (mp1rms) has a daily time step (x-axis) and negative values (y-axis). The second time series (ndvi) has a 16-day time step (x-axis) and positive values (y-axis). I can get the y-axes to display and label properly, but I'm having trouble with the x-axis, e.g. one of the time series gets "compressed" for lack of a better description. My code looks like this:
par(mar=c(5,4,4,4)+0.1,cex=1.5)
plot(date1,mp1rms,type="p",col="red",pch=19,axes=F,xlab="",ylab="",ylim=c(-30,-38),cex=0.6)
mtext("mp1rms (cm)", side=2,col="black",line=2.5,cex=1.5)
axis(2,col="black",labels=TRUE,)
title(main=substr(base,1,4))
par(new=TRUE)
plot(ydoy2,ndvi,col="green",type="o",pch=20,ylim=c(min(ndvi),max(ndvi)+0.1),axes=F,xlab="",ylab="")
axis(4,col.axis="red",labels=TRUE)
mtext("250m NDVI", side=4,col="black",padj=4,cex=1.5)
axis(1,col.axis="black",labels=TRUE)
legend("topleft",cex=0.6,c("mp1rms","ndvi"),col=c("red","green"),pch=19:20)
box()
dev.off()
any help would be greatly appreciated ;)
thanks!
Cheney