Questions tagged [tmap]

tmap is an actively maintained open-source R-library for drawing thematic maps, written by Martijn Tennekes. The API is based on the Layered Grammar of Graphics, and resembles the syntax of ggplot2, a popular R-library for drawing charts.

tmap is an actively maintained open-source R-library for drawing thematic maps, written by Martijn Tennekes. The API is based on A Layered Grammar of Graphics by Hadley Wickham and resembles the syntax of , a popular R-library for drawing charts.

Repositories

Vignette

Presentation

Other resources

487 questions
4
votes
1 answer

How do you adjust facet row label height in faceted tmap plots?

I am plotting faceted maps using the "tmap" package with rows and columns. I am unable to adjust the height of the facet labels for the rows which results in facet labels being cropped when they are bigger than a certain size or rotated. I have…
zarrar
  • 47
  • 7
4
votes
1 answer

How do I add an additional comment to a map using tmap in R?

I want to add an additional comment to a map in tmap in R that is not the title (I want it to be an additional comments in the lower left corner that specifies the source of the data, example). Is there a function to do so? Thanks!
dkro
  • 193
  • 1
  • 8
4
votes
1 answer

Adding fixed size breaks with tmap tm_bubble

I am trying to create a tmap bubbleplot where the size and color aesthetics have the same fixed breaks. Setting the style = "fixed" and breaks = c(-Inf, seq(-10, 10, by = 2.5), Inf) is producing the desired result for the color variable, but the…
philiporlando
  • 941
  • 4
  • 19
  • 31
4
votes
1 answer

How to rotate symbols (representing spatial point data) based on feature with tmap and sf?

I want to represent 2 ships on a map in an interactive way (leaflet based method) with some of their metadata as well. Naturally, metadata of a ship usually contains the heading of the vessel and the most digestible way to represent is by rotating…
4
votes
1 answer

In R tmap, how do I control layer visibility in interactive mode?

Starting with a toy example I can quickly get an interactive map in tmap with the following code: library(tmap) tmap_mode("view") data("World", "metro") tm_shape(World) + tm_polygons() + tm_shape(metro) + tm_dots("pop2010", col =…
radek
  • 7,240
  • 8
  • 58
  • 83
4
votes
1 answer

Ploting 3 maps in 2 rows using R tmap package

I'm trying to save a plot using 3 maps made by the tmap package, with the larger one at the top, and the other 2 at the bottom like the example above: But using tmap_arrange() provided by the package for this kind of procedure, it gives me the…
Luis Antolin
  • 144
  • 1
  • 7
4
votes
1 answer

How to plot GeoTIFF using tmap in R?

A simple plotRGB leads to the original image while plotting with tmap returns only a blue-shaded image. What am I doing wrong? original image blue-shaded image Code snippet: library(raster) library(tmap) library(rnaturalearth) ne_download(scale =…
shar0n
  • 41
  • 1
4
votes
1 answer

line connecting label text and point in tmap plot

i'm doing a tmap plot with a shape file, and i want to be plotting several points for which i have long-lat coordinates onto the shape file. i've got the plot working just fine, however there are too many points on the map, meaning that the label…
nikUoM
  • 639
  • 1
  • 8
  • 18
4
votes
2 answers

Manipulating the font of a legend title with tmap

First time posting on stackoverflow. I've been learning to work with tmap, and have gotten almost everything down for the choropleth maps that I need. However, the finishing touch that I can't seem to find an answer to is making the legend title…
Cody Brown
  • 41
  • 1
  • 2
4
votes
2 answers

R-Package tmap/protolite installation failed:

I am working on Ubuntu 16.04 with R-version 3.4.2. I want to install the R-Package "protolite" (more precisely, I want to install "tmap" where protolite is a prerequisite). I have libprotocol version 2.6.1 installed: $ protoc --version returns…
Florestan
  • 127
  • 1
  • 15
4
votes
1 answer

How can I make a legend show size and color for tm_bubbles in R?

I am trying to develop a simple map with bubbles representing size. library(tmap) data(World, metro) example.map <- tm_shape(World)+ tm_borders()+ tm_shape(metro)+ tm_bubbles(size = "pop2010", col = "pop2010", …
Novo88
  • 109
  • 1
  • 7
4
votes
2 answers

Popup on a shape using tmap

I have made a map unsing tmap to include in a shiny app using leaflet. I have roughly what I want: a thematic map with fill color based on a SpatialPolygonsDataFrame, and when you click the map, a popup with extra information on the polygon. I would…
FlorianGD
  • 2,336
  • 1
  • 15
  • 32
4
votes
2 answers

Column with color values in tmap

I have a SpatialPolygonsDataFrame with columns containing hex-color values. I want to draw the map like this with the package tmap: tm_shape(full.shp) + tm_fill(col="konf1900") But then it is treated as categorial variable, resulting in this: I am…
Mario
  • 2,393
  • 2
  • 17
  • 37
3
votes
1 answer

Create a map of spain with lakes

I have a shapefile of water from Spain and boundaries shapefile of Spain. boundaries shapefile called boundaries and water shapfile is called water boundaries <- st_read("boundaries_spain.shp") water <- st_read("water_spain.shp") I changed the…
user19729000
3
votes
1 answer

Tmap: Cannot create school district map for national level

I want to plot school districts on a national map in R using the library Tmap. I used a shapefile from the official website, the National Center for Education Statistics, for school district boundaries. Please note that I used the 2019 file instead…
Kob
  • 147
  • 1
  • 11
1 2
3
32 33