Description Usage Arguments Value Author(s) See Also Examples
Adds diagonal lines to a plot, spaced by by
x-units. This can
be of aid in the interpretion of catch curves. The ‘z’
in zlines
refers to total mortality rate, usually denoted
Z.
1 |
slope |
slope of diagonal lines sent to argument |
by |
spacing of diagonal lines in x-units. |
... |
passed to |
Invisible vector of intercepts.
Sigurður Þór Jónsson.
abline
is called iteratively to draw the lines.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ## Any plot, slanting up or down
plot(rnorm(10,10,10), rnorm(10,10,10))
zlines(1)
zlines(1, by=2, col="blue")
zlines(-1, col="red")
## Catch curve
slope <- -0.6
yclasses <- unique(catage$ycl)
mycol <- rainbow(length(yclasses))
tmp <- tapply(catage$ObsCno, list(catage$year,catage$age), sum)
matplot(1980:2009, log(tmp), type="n", ylab="log(catage)", xlab="Year",
asp=2)
grid(col="grey", lty=2)
zlines(slope=slope, col="grey", lty=2)
for(i in seq(along=yclasses))
{
tmp <- catage[catage$ycl==yclasses[i],]
lines(tmp$year, log(tmp$ObsCno), col=mycol[i])
text(tmp$year, log(tmp$ObsCno), tmp$age, col=mycol[i])
}
text(par("usr")[1]+par("cxy")[1], par("usr")[4]-par("cxy")[2],
paste("slope =",slope), adj=0)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.