Description Usage Arguments Value See Also Examples
Function to plot time series of atlantis ncdf output.
1 2 3 4 5 6 7 8 9 10 |
data |
Dataframe to be plotted. |
x |
x-variable. Default is |
y |
y-variable. Default is |
wrap |
Wraping column. Default is |
col |
Column to use as colour. Default is |
ncol |
Number of columns in multipanel plot. Default is |
yexpand |
Expands the y axis so it always includes 0. Default is |
ylim |
Numeric vector. lower and upper limits of yaxis, eg c(0,1) |
ggplot2 object
Other plot functions:
plot_bar()
,
plot_boxes()
,
plot_diet_bec_dev()
,
plot_diet()
,
plot_rec()
,
plot_species()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | plot_line(preprocess$biomass)
plot_line(preprocess$biomass, col = "species")
plot_line(preprocess$biomass_age, col = "agecl")
plot_line(preprocess$biomass_age, wrap = "agecl", col = "species")
# The function can also be used to compare model outoput with observed data.
d <- system.file("extdata", "setas-model-new-becdev", package = "atlantistools")
ex_data <- read.csv(file.path(d, "setas-bench.csv"), stringsAsFactors = FALSE)
names(ex_data)[names(ex_data) == "biomass"] <- "atoutput"
data <- preprocess$biomass
data$model <- "atlantis"
comp <- rbind(ex_data, data, stringsAsFactors = FALSE)
# Show atlantis as first factor!
lev_ord <- c("atlantis", sort(unique(comp$model))[sort(unique(comp$model)) != "atlantis"])
comp$model <- factor(comp$model, levels = lev_ord)
# Create plot
plot_line(comp, col = "model")
## Not run:
# Use \code{\link{convert_relative_initial}} and \code{\link{plot_add_box}}
# with \code{\link{plot_line}}. Use \code{\link{convert_relative_initial}} to
# generate a relative time series first.
df <- convert_relative_initial(preprocess$structn_age)
# Create the base plot with \code{\link{plot_line}}.
plot <- plot_line(df, col = "agecl")
# Add lower and upper range.
plot_add_box(plot)
# Create spatial timeseries plots in conjuction with \code{\link{custom_grid}}.
plot <- plot_line(preprocess$physics, wrap = NULL)
custom_grid(plot, grid_x = "polygon", grid_y = "variable")
plot <- plot_line(preprocess$flux, wrap = NULL, col = "variable")
custom_grid(plot, grid_x = "polygon", grid_y = "layer")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.