[R] Adding x and y axis labels with the function plot.sensFun (package FME)
Marine Regis
marine.regis at hotmail.fr
Wed Jan 25 02:32:59 CET 2017
Hello,
How can I add x and y axis labels for a plot that is built from the function plot.sensFun (package FME) ? I tested xlab ="Time" and ylab="Population size" but this doesn't work for me.
Here is a code to generate the plot:
pars <- list(gmax = 0.5, eff = 0.5,
ks = 0.5, rB = 0.01, dB = 0.01)
solveBact <- function(pars) {
derivs <- function(t, state, pars) { # returns rate of change
with (as.list(c(state, pars)), {
dBact <- gmax * eff * Sub/(Sub + ks) * Bact - dB * Bact - rB * Bact
dSub <- -gmax * Sub/(Sub + ks) * Bact + dB * Bact
return(list(c(dBact, dSub)))
})
}
state <- c(Bact = 0.1, Sub = 100)
tout <- seq(0, 50, by = 0.5)
## ode solves the model by integration ...
return(as.data.frame(ode(y = state, times = tout, func = derivs,
parms = pars)))
}
## sensitivity functions
SF <- sensFun(func = solveBact, parms = pars,
sensvar = c("Bact", "Sub"), varscale = 1)
par(mfrow = c(1,2))
plot(SF, which = c("Sub", "Bact"), mfrow = NULL, xlab="Time", ylab="Population size")
Thanks a lot for your time.
Marine
[[alternative HTML version deleted]]
More information about the R-help
mailing list