Skip to content
Back to formatted view

Raw Message

Message-ID: <AM5PR0701MB23381A40C4C54E5EB42B7D5AE2740@AM5PR0701MB2338.eurprd07.prod.outlook.com>
Date: 2017-01-25T01:32:59Z
From: Marine Regis
Subject: Adding x and y axis labels with the function plot.sensFun (package FME)

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]]