0

Been searching around and can't find an example of tmap using the tm_iso function. Can anyone find any? This is all the tmap github description for tm_iso has:

tm_iso(
  col = NA,
  text = "level",
  size = 0.5,
  remove.overlap = TRUE,
  along.lines = TRUE,
  overwrite.lines = TRUE,
  bg.color = tmap_options()$bg.color,
  group = NA,
  ...
)
Blaiso
  • 165
  • 9

1 Answers1

0

Actually this one works well, raster/contour data taken from this question: raster::rasterToContour; contour lines are not continuous

and tmap from here: How to draw contour lines from a simple feature (i.e., column values) of an sf object

## import raster from raster package
library(raster)

## define file location (default for the raster package)
f <- system.file("external/test.grd", package="raster")
## import raster
r <- raster(f)
## create contours
x <- st_as_sf(rasterToContour(r))
class(x)
plot(r)
plot(x, add=TRUE)

tm_shape(x) + tm_iso(col = 'level', text = 'level')

output contour plot

Blaiso
  • 165
  • 9