This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
## Example for an entirely non-smart scalebar, which can be added to a ggplot2 object | |
## Author: Benjamin Leutner (@bleutner) | |
## | |
ggScalebar <- function(origin, ## raster object or vector in the form of c(xmin, ymin) | |
breaks = seq(0, 10000, 1000), ## breaks for the scale bar | |
yoff = 1000, xoff = 1000, ## position offset from origin in x and y direction (in map units) | |
sdist = 1000, ## length of major ticks (in map units) | |
tdist = 1000, ## distance labels to ticks (in map units) | |
size = 1, ## linewidth of scalebar |