ridgemap: Create a topographic ridgeline map from elevation data

View source: R/ridgeline_topography.R

ridgemapR Documentation

Create a topographic ridgeline map from elevation data

Description

Using elevation data in the form of a raster, matrix, or data frame, create a map using ridgeline plotting.

Usage

ridgemap(
  elev_data,
  line_color = "white",
  background_color = "gray10",
  line_count = NULL,
  y_scalar = 100,
  scale_factor = 1,
  line_weight = 0.5,
  min_height = 0
)

Arguments

elev_data

Raster, matrix, or data frame. The elevation data. If a raster, the value in each cell must represent the elevation. If a matrix, the values must be the elevations and the rows and columns must correspond to the x and y coordinates, respectively. If a data frame, there must be the variables "x", "y", and "elev" containing the x coordinates, y coordinates, and elevations.

line_color

Character string. The color for the ridgelines. Must be recognizable by ggplot, e.g. "white" or "#ffffff". Defaults to "white".

background_color

Character string. The color for the ridgelines. Must be recognizable by ggplot, e.g. "black" or "#000000". Defaults to "gray10".

line_count

Optional numeric. The number of ridgelines to draw. If this is NULL or greater than or equal to the number of available latitude lines in the data, all possible lines will be drawn. If it is fewer than the available latitudes, only this many lines will be drawn, using an evenly-spaced subset of the data. Defaults to NULL.

scale_factor

Numeric. The vertical scaling factor to apply to the elevations in the plot. Larger values result in more exaggerated topography. Defaults to 1.

line_weight

Numeric. The thickness of the ridgelines. Used as the size argument in the geom_ridges() call. Defaults to 0.5.

min_height.

Numeric. The minimum height to display. Used by geom_ridges(). Defaults to 0.

Value

A ridgeline elevation map as a ggplot object


nstauffer/topo.ridges documentation built on June 29, 2023, 10:22 a.m.