Plot a RMODFLOW list object
# S3 method for rmf_list rmf_plot( obj, dis, bas = NULL, mask = NULL, i = NULL, j = NULL, k = NULL, variable = "id", geom = "polygon", type = "fill", levels = NULL, group = NULL, active_only = FALSE, fun = sum, add = FALSE, prj = rmf_get_prj(dis), crs = NULL, colour_palette = rmfi_rev_rainbow, nlevels = 7, legend = ifelse(variable == "id", FALSE, !add), crop = FALSE, gridlines = FALSE, ... )
obj | a |
---|---|
dis | a |
bas | a |
mask | a 3D array with 0 or FALSE indicating inactive cells; optional; defaults to having all cells active or, if bas is provided, the first layer of bas$ibound |
i | row number to plot |
j | column number to plot |
k | layer number to plot |
variable | single character or numeric indicating which column in the |
geom | either 'polygon' (default), 'line' or 'point'. Defines how the rmf_list features are plotted. See details. |
type | plot type: 'fill' (default), 'factor', 'grid', 'contour' or 'vector' |
levels | (named) character vector with labels for the factor legend. If not named, factor levels are sorted before being labelled. If NULL, the array factor levels are used |
group | variable name or index in |
active_only | logical; indicating if only the active cells should be plotted. Non-active cells are set to NA. Defaults to FALSE. |
fun | function to compute values in the case multiple values are defined for the same MODFLOW cell. Typically either |
add | logical; if TRUE, provide ggplot2 layers instead of object, or add 3D plot to existing rgl device; defaults to FALSE |
prj | projection file object |
crs | coordinate reference system for the plot |
colour_palette | a colour palette for imaging continuous array values. If type = 'contour' or 'vector', a single character can also be used. |
nlevels | number of levels for the colour scale; defaults to 7 |
legend | either a logical indicating if the legend is shown or a character indicating the legend title |
crop | logical; should plot be cropped to the domain represented by the features; defaults to FALSE |
gridlines | logical; should grid lines be plotted? alternatively, provide colour of the grid lines. |
... | additional arguments passed to either |
ggplot2 object or layer
If geom = 'polygon'
, the rmf_list is converted to a rmf_3d_array using rmf_as_array.rmf_list
. The sparse argument is set to FALSE.
If geom = 'line'
, ggplot2::geom_path
is used. If geom = 'point'
, ggplot2::geom_point
is used.
geom = 'line'
will only work optimally if the group
argument is set.