ggplot_add_flownet: Add flownet to an existing ggplot

View source: R/flownet_plotting.R

ggplot_add_flownetR Documentation

Add flownet to an existing ggplot

Description

Function to add a flow net to an existing ggplot. If the plot does not exist yet, a new one if created

Usage

ggplot_add_flownet(
  df,
  dp,
  di = NULL,
  Nf = 5,
  linewidth = 0.5,
  colour_flowline = "black",
  colour_equipotentialline = "black",
  fill = "#aebab7",
  plt = NULL,
  xlab = "x [m]",
  ylab = "z [m]",
  xlim = c(NA, NA),
  ylim = c(NA, NA),
  axes = TRUE
)

Arguments

df

tibble with domains/problem description

dp

flow net solution tibble

di

flow net solution rectangular interpolation tibble. This tibble is used for plotting contour lines (flow lines and equipotential lines). If the grid is rectangular, this is simply equal to 'dp'. If not, an interpolation function is used. If not defined, it is calculated from 'dp'

Nf

number of requested flow paths

linewidth

line thickness for all lines

colour_flowline

colour of flow lines

colour_equipotentialline

colour of equipotential lines

fill

fill colour for (saturated) soil

plt

a ggplot object. If not defined, a new plot is generated

xlab, ylab

x and y-axis label - if 'plt' not defined

xlim, ylim

user-defined axis limits - if 'plt' not defined

axes

if 'FALSE' no axes are plotted - if 'plt' not defined

Value

a ggplot object

Examples

#rectangular grid
df <- flownet_geometry_rectangular()
dp <- flownet_solve_rectangular(df)
ggplot_add_flownet(df, dp, axes = FALSE)
ggplot_add_flownet(df, dp, axes = TRUE, fill = NA)

#quadrilateral grid
df <- flownet_geometry_quadrilateral()
dp <- flownet_solve_quadrilateral(df)
di <- flownet_interpolate_quadrilateral(df, dp)
ggplot_add_flownet(df, dp, di = di, axes = FALSE)

GJMeijer/soilmech documentation built on May 22, 2022, 10:39 a.m.