ggplot_add_soilmarker: Annotate soil surface marker to a ggplot object

View source: R/utility_plotgeometry.R

ggplot_add_soilmarkerR Documentation

Annotate soil surface marker to a ggplot object

Description

Adds a standard soil surface indicator icon to an existing ggplot object

Usage

ggplot_add_soilmarker(
  plt,
  xc,
  yc,
  theta = 0,
  scale = 1,
  linesize = 0.5,
  colour_soil = "#65571d",
  n = 3
)

Arguments

plt

ggplot object

xc, yc

x and y-position where marker touches the soil surface (middle)

theta

rotation angle (in case label needs to be rotated, in rad)

scale

scaling factor for marker. Default width is approx 1

linesize

thickness of lines

colour_soil

line colour for all lines

n

number of lines to plot underneath the water table, as part of the symbol

Value

ggplot object with added water table marker

Examples

#generate simple plot
plt <- ggplot2::ggplot() +
  ggplot2::annotate("rect", xmin = -2, xmax = 2, ymin = -2, ymax = 2, fill = "yellow") +
  ggplot2::coord_fixed(ratio = 1)

#add water table marker
ggplot_add_soilmarker(plt, x = 1, y = 1, scale = 1, theta = 0.5)

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