View source: R/flownet_plotting.R
ggplot_add_flownet | R Documentation |
Function to add a flow net to an existing ggplot. If the plot does not exist yet, a new one if created
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 )
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 |
a ggplot object
#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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.