---
params: 
    title: ""
    Pars: "`r list()`"
    plotPars: "`r list()`"
    tabs: "`r TRUE`"
    its: " `r numeric()`"
    nyears: " `r numeric()`"
    proyears: " `r numeric()`"
    date: "`r Sys.Date()`"
title: "`r params$title`"
date: "`r params$date`"
output:
  html_document
---


```{r, echo=FALSE, results="asis"}
if (params$tabs) {
  cat('### Depletion and Discard Mortality {.tabset .tabset-fade .tabset-pills}' )
} else {
  cat('### Depletion and Discard Mortality')
}
Pars <- params$Pars
dd <- dim(Pars$M_ageArray)
nsim <- dd[1]
maxage <- dd[2]

nsamp <- length(params$its)


```

#### Sampled Parameters 
Histograms of `r nsim` simulations of depletion (spawning biomass in the last historical year over average unfished spawning biomass; `D`) and the fraction of discarded fish that are killed by fishing mortality (`Fdisc`), with vertical colored lines indicating `r nsamp` randomly drawn values.

```{r, echo=FALSE}
par(mfrow=c(1,2))
hist2(Pars$D, col=params$plotPars$col, axes=params$plotPars$axes, main="Depletion (D)", breaks=params$plotPars$breaks)
abline(v=Pars$D[params$its], col=1:nsamp, lwd=params$plotPars$lwd)
axis(side=1) 

hist2(Pars$Fdisc, col=params$plotPars$col, axes=params$plotPars$axes, main="Fdisc", breaks=params$plotPars$breaks)
abline(v=Pars$Fdisc[params$its], col=1:nsamp, lwd=params$plotPars$lwd)
axis(side=1)
```


