\documentclass[a4paper]{article}
\SweaveOpts{echo=FALSE,eps=FALSE,fig=TRUE,keep.source=TRUE}
%\VignettePackage{scape}
%\VignetteIndexEntry{Gallery}
\usepackage{parskip}
\usepackage{hyperref}
\newcommand\p[1]{{\fontseries{b}\selectfont #1}}
\begin{document}

\title{The \p{scape} gallery}
\author{Arni Magnusson}
\maketitle

\tableofcontents

\newpage

~\vspace{3em}
\begin{flushright}
  \begin{minipage}{3in}
    \textsf{\textit{{\fontfamily{cmss}\fontseries{bx}\fontshape{it}\selectfont
          scape, n.} A view of scenery of any kind,\\
        whether consisting of land, water, cloud,\\
        or anything else.}\\
      \hspace*{5em}---\hspace{1pt}Oxford English Dictionary}
  \end{minipage}
\end{flushright}

\section{Overview}

This vignette is only a series of plots, demonstrating how the \p{scape} plot
examples look in a PDF document, as opposed to the default graphics device.
Useful for package maintenance and as a visual overview of the package.

A general introduction to the \p{scape} and \p{plotMCMC} packages is in the
vignette \href{dsc-vignette.pdf}{R goes fishing}.

<<require,fig=FALSE>>=
require(scape)
@

\newpage

\section{plotB}

<<B1>>=
plotB(x.ling, series=c("VB.1","VB.2","Y"), div=1000, xlab="Year\n",
      ylab="Biomass and landings (1000 t)")
@

<<B2>>=
plotB(x.ling, "s", div=1000, xlab="Biomass age 4+ (1000 t)",
      ylab="Recruitment (million one-year-olds)")
@

\section{plotCA}

<<CA1>>=
plotCA(x.sbw, fit=FALSE, strip=FALSE, xlab="Age", ylab="Year",
       tick.number=10)
@

<<CA2>>=
plotCA(x.cod, xlab="Age", ylab="Proportion in catch", cex.strip=0.7,
       cex.axis=0.7, col.lines="brown", layout=c(8,4))
@

<<CA3>>=
plotCA(x.cod, xlab="Age", ylab="Proportion in catch", cex.strip=0.7,
       cex.axis=0.7, col.lines="brown", layout=c(2,4), swap=TRUE,
       ages=3:10, same.limits=FALSE)
@

<<CA4>>=
plotCA(x.ling, "s", col.points=c("red","blue"), lty.lines=0, xlab="Age",
       ylab="Observed proportion in survey", tck=0.5, cex.strip=0.7,
       cex.axis=0.7)
@

<<CA5>>=
plotCA(x.ling, "s", xlab="Age", ylab="Observed proportion in survey",
       fit=FALSE, cex.strip=0.7, cex.axis=0.7, tck=0.5, layout=c(5,2))
@

<<CA6>>=
plotCA(x.ling, "s", xlab="Age", ylab="Observed proportion in survey",
       fit=FALSE, cex.strip=0.7, cex.axis=0.7, tck=0.5, layout=c(5,6),
       swap=TRUE)
@

\section{plotCL}

<<CL1>>=
plotCL(x.ling, fit=FALSE, strip=FALSE, series="1", sex="Female",
       xlab="Length (cm)", ylab="Year")
@

<<CL2>>=
plotCL(x.oreo, xlab="Length (cm)", ylab="Proportion in catch")
@

<<CL3>>=
plotCL(x.oreo, "s", layout=c(2,1), xlab="Length (cm)",
       ylab="Observed proportion in survey", cex.points=0.8,
       col.points=c("red","blue"), lty.lines=0)
@

<<CL4>>=
plotCL(x.ling, fit=FALSE, series="2", xlab="Length (cm)",
       ylab="Observed proportion in trawl catch", tck=0.5)
@

<<CL5>>=
plotCL(x.ling, series="2", swap=TRUE, lengths=70:150, lty.grid=0)
@

\section{plotIndex}

<<Index1>>=
plotIndex(x.cod, xlab="Year", ylab="Survey abundance index",
          strip=FALSE)
@

<<Index2>>=
plotIndex(x.oreo, "c", series="Series 1-1", xlim=c(1981,1990))
@

<<Index3>>=
plotIndex(x.oreo, "c", xlim=list(c(1981,1990),c(1992,2002)),
          xlab="Year", ylab="Observed CPUE",
          col.points=c("salmon","seagreen"), lty.lines=0)
@

\section{plotLA}

<<LA1>>=
plotLA(x.oreo, xlab="Age", ylab="Length (cm)")
@

<<LA2>>=
mykey <- list(text=list(lab=c("Female","Male")), space="right",
              lines=list(lwd=4,col=c("red","blue")))
plotLA(x.oreo, together=TRUE, xlab="Age", ylab="Length (cm)", pch=NA,
       key=mykey)
@

<<LA3>>=
mykey <- list(text=list(lab=c("Female","Male")), space="right",
              points=list(pch=16,cex=0.5,col=c("red","blue")))
plotLA(x.oreo, together=TRUE, xlab="Age", ylab="Length (cm)",
       col.points=c("red","blue"), lty.lines=0, key=mykey)
@

\section{plotN}

<<N1>>=
plotN(x.cod, div=1000, xlab=c("Age (years)","Year"),
      ylab="Individuals (million)")
@

<<N2>>=
plotN(x.cod, "l", div=1000, xlab="Age", ylab="Individuals (million)")
@

<<N3>>=
plotN(x.cod, "r", age=3, div=1000, xlim=c(1967,2002))
@

<<N4>>=
plotN(x.cod, "p", div=1000, ages=3:10, xlim=c(2,11), xlab="Age",
      ylab="Individuals (million)", cex.strip=0.7, cex.axis=0.7,
      tck=0.5)
@

<<N5>>=
plotN(x.cod, "b", xlab="Age (years)", ylab="Year", cex.points=0.7)
@

\section{plotSel}

<<Sel1>>=
plotSel(x.ling, xlab="Age", ylab="Selectivity and maturity")
@

<<Sel2>>=
plotSel(x.cod, together=TRUE, xlab="Age\n", ylab="Selectivity",
        pch=NA, col.lines=c("coral","navyblue"), strip=FALSE)
@

\end{document}
