Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
mtennekes committed Feb 12, 2024
1 parent 80bb9b0 commit afbf4e8
Showing 1 changed file with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions sandbox/issues.R
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,27 @@ tm_shape(tanzania) +
tm_scalebar(c(0, 200, 400), position = c("left", "bottom"))



library(sf)
#> Linking to GEOS 3.12.1, GDAL 3.7.3, PROJ 9.2.1; sf_use_s2() is TRUE
f = system.file("shapes/world.gpkg", package = "spData")
world = read_sf(f)
tanzania = read_sf(f, query = 'SELECT * FROM world WHERE name_long = "Tanzania"')

tmap_design_mode()
tm_shape(tanzania) +
tm_polygons(lwd = 2) +
tm_scalebar(c(0, 200, 400), position = tm_pos_out("left", "bottom"))

tm_shape(tanzania) +
tm_polygons(lwd = 2) +
tm_scalebar(c(0, 200, 400), position = tm_pos_out("center", "bottom"))

tm_shape(tanzania) +
tm_polygons(lwd = 2) +
tm_title("c(0, 200, 400)", position = tm_pos_out("center", "bottom"))


###########################################################
# https://github.com/r-tmap/tmap/issues/811
###########################################################
Expand Down Expand Up @@ -621,3 +642,31 @@ is.factor(r)
cls <- data.frame(id=1:3, cover=c("forest", "water", "urban"))
levels(r) <- cls
is.factor(r)





###### component size

# set device asp to ~3

#process_meta L406

tm_shape(World) +
tm_polygons("HPI")

# why is the fW larger?:
tm_shape(World) +
tm_polygons("HPI") +
tm_compass(size = .1,position = tm_pos_out("right", "center"))

# should be rescaled:
tm_shape(World) +
tm_polygons("HPI") +
tm_compass(size = 16,position = tm_pos_out("right", "center"))


## 835
tm_shape(rivers)+
tm_lines(col = "scalerank", lwd = 5, lineend = "butt")

0 comments on commit afbf4e8

Please sign in to comment.