| Title: | Tilt your Maps and Turn Them into 'ggplot' Plots |
|---|---|
| Description: | Simplifies the whole process of creating stacked tilted maps, that are often used in scientific publications to show different environmental layers for a geographical region. Tilting maps and layering them allows to easily draw visual correlations between these environmental layers. |
| Authors: | Marco Sciaini [aut, cph], Cédric Scherer [aut], Josh Erickson [ctb], Egor Kotov [ctb, cre] (ORCID: <https://orcid.org/0000-0001-6690-5345>) |
| Maintainer: | Egor Kotov <[email protected]> |
| License: | CC0 |
| Version: | 0.0.4.9000 |
| Built: | 2026-06-03 08:47:06 UTC |
| Source: | https://github.com/marcosci/layer |
Random curd neutral landscape model generated using the NLMR package.
landscape_1landscape_1
A raster object.
Data generated using the NLMR package. See Sciaini et al. (2018) for details: doi:10.1111/2041-210X.13076.
Fractional Brownian motion neutral landscape model generated using the NLMR package.
landscape_2landscape_2
A raster object.
Data generated using the NLMR package. See Sciaini et al. (2018) for details: doi:10.1111/2041-210X.13076.
Distance gradient neutral landscape model generated using the NLMR package.
landscape_3landscape_3
A raster object.
Data generated using the NLMR package. See Sciaini et al. (2018) for details: doi:10.1111/2041-210X.13076.
Random curd neutral landscape model generated using the NLMR package.
landscape_pointslandscape_points
A raster object.
Data generated using the NLMR package. See Sciaini et al. (2018) for details: doi:10.1111/2041-210X.13076.
Takes tilted maps and plots them with ggplot.
plot_tiltedmaps( map_list, layer = NA, palette = "viridis", color = "grey50", direction = 1, begin = 0, end = 1, alpha = 1 )plot_tiltedmaps( map_list, layer = NA, palette = "viridis", color = "grey50", direction = 1, begin = 0, end = 1, alpha = 1 )
map_list |
sf or terra/stars/raster object. |
layer |
vector or list of names of each column in tilted sf object that should be used for coloring |
palette |
vector of palettes provided by the viridis and scico packages for rasters |
color |
a single color applied multiple times or a vector of color strings for points or linestrings |
direction |
|
begin |
vector of the of the start of interval the palette to sample colours from for viridis and scico color palettes |
end |
vector of the of the end of interval the palette to sample colours from for viridis and scico color palettes |
alpha |
A ggplot object with stacked maps.
# tilt data tilt_landscape_1 <- tilt_map(landscape_1) tilt_landscape_2 <- tilt_map(landscape_2, x_shift = 50, y_shift = 50) # plot map_list <- list(tilt_landscape_1, tilt_landscape_2) plot_tiltedmaps(map_list, palette = "turbo")# tilt data tilt_landscape_1 <- tilt_map(landscape_1) tilt_landscape_2 <- tilt_map(landscape_2, x_shift = 50, y_shift = 50) # plot map_list <- list(tilt_landscape_1, tilt_landscape_2) plot_tiltedmaps(map_list, palette = "turbo")
Tilt and shift maps in any direction.#'
tilt_map( data, x_stretch = 2, y_stretch = 1.2, x_tilt = 0, y_tilt = 1, x_shift = 0, y_shift = 0, angle_rotate = pi/20, boundary = NULL, parallel = FALSE )tilt_map( data, x_stretch = 2, y_stretch = 1.2, x_tilt = 0, y_tilt = 1, x_shift = 0, y_shift = 0, angle_rotate = pi/20, boundary = NULL, parallel = FALSE )
data |
sf or terra/stars/raster object. |
x_stretch |
Stretch in x dimension. A |
y_stretch |
Stretch in y dimension. A |
x_tilt |
Tilt in x dimension. A |
y_tilt |
Tilt in y dimension. A |
x_shift |
Shift in x dimension. A |
y_shift |
Shift in y dimension. A |
angle_rotate |
Rotation angle.. A |
boundary |
Another layer that is used to create a boundary that is drawn around the data |
parallel |
|
Code adopted from https://www.mzes.uni-mannheim.de/socialsciencedatalab/article/geospatial-data/.
An sf object with tilted and shifted data.
tilt_map(landscape_1)tilt_map(landscape_1)