Uses ggplot2 to create a grainsize vs. depth stratigraphic section plot.
ggstrat(
df,
section_name,
grainsize_direction = c("increasing", "decreasing"),
grainsize_labs = gs_volc_abbr,
use_theme = NULL,
xlim = c(-1, 10),
ylim = NULL,
depth_units = c("cm", "m"),
ybreaks = 7,
layer_fill = "layer_type",
layer_fill_color = "stratpal_rpg",
layer_border_color = "black",
layer_border_linewidth = 0.2
)A ggplot object
A data frame containing stratigraphic data.
Must include columns stratsection_name, stratlayer_order,
grainsize, depth, and stratlayer_type.
Character string giving the section name to filter "stratsection_name".
Character string, one of "increasing" or
"decreasing". Controls the numeric mapping of grain sizes:
"increasing" (default): clay/silt = 1, ..., blocks/bombs/boulders = 10.
"decreasing": clay/silt = 10, ..., blocks/bombs/boulders = 1.
Increasing will show coarser units as bigger polygons (more prominent) which is espeically useful for emphasizing more energentic volcanic deposits. Decreasing will show finer (typically more resistive) units as bigger which may better match observed erosional profiles.
Character vector of labels for the x-axis. Several predefined options are available:
gs_volc_abbr: Volcanic grainsize abbreviations (default).
gs_sed_abbr: Sedimentary grainsize abbreviations.
gs_volc_names: Volcanic grainsize full names.
gs_sed_names: Sedimentary grainsize full names.
gs_numeric: Numeric grainsize labels.
A ggplot2 theme object to apply to the plot, e.g., "theme_avstrat".
Numeric vector of length 2 giving x-axis limits.
Numeric vector of length 2 giving y-axis limits (optional).
Units to use for depth (y-axis) scale, either "cm" (default) or "m".
Number of breaks on the y-axis.
Character string naming the column to use for fill. If using anything other than "layer_type" from the template, will need to make a new palette.
Palette object to use for fill colors.
Border color for polygons.
Border line width for polygons.
example_data_strat |>
add_depths() |>
ggstrat(section_name = "21LSHD02")
Run the code above in your browser using DataLab