You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current version of plot.catchCurve() hard-wires the y-axis limits. This should be fixed to allow the user to set the limits. The following change works but it may be better to have ylim=NULL in the function definition, query if it is NULL, and the set the default limits as shown.
plot.catchCurve <- function(x,pos.est="topright",cex.est=0.95,
ylab="log(Catch)",xlab="Age",
col.pt="gray30",col.mdl="black",lwd=2,lty=1,
ylim=c(min(0,min(log(x$catch),na.rm=TRUE)),max(log(x$catch),na.rm=TRUE)),
...) {
# nocov start
# Plot raw data
graphics::plot(log(x$catch)~x$age,col=col.pt,xlab=xlab,ylab=ylab,ylim=ylim,...)
# Highlight descending limb portion
graphics::points(x$age.e,x$log.catch.e,col=col.pt,pch=19)
# Put model on descending limb
graphics::lines(x$age.e,stats::predict(x$lm,data.frame(x$age.e)),lwd=lwd,lty=lty,col=col.mdl)
# Put mortality values on the plot
if (!is.null(pos.est)) {
Z <- -stats::coef(x$lm)[2]
A <- 100*(1-exp(-Z))
graphics::legend(pos.est,legend=paste0("Z=",round(Z,3),"\nA=",round(A,1),"%"),
bty="n",cex=cex.est)
}
} # nocov end
This function was written a long time ago. Probably worth making other edits (e.g., not hard-wiring the rounding values).
Thanks to Brendan Runde ... North Carolina State.
The text was updated successfully, but these errors were encountered:
The current version of
plot.catchCurve()
hard-wires the y-axis limits. This should be fixed to allow the user to set the limits. The following change works but it may be better to haveylim=NULL
in the function definition, query if it isNULL
, and the set the default limits as shown.This function was written a long time ago. Probably worth making other edits (e.g., not hard-wiring the rounding values).
Thanks to Brendan Runde ... North Carolina State.
The text was updated successfully, but these errors were encountered: