Tmap: Option to increase space between axis titles and axis

Created on 19 Nov 2018  路  4Comments  路  Source: mtennekes/tmap

Hi @mtennekes

Thank you... tmap is awesome!

I want to move the axis title a little to avoid the overlap. Can you add an option to set the space please?

captura de pantalla 2018-11-18 a la s 22 27 51

Best, Roberto.

Most helpful comment

Done! I've added an argument to tm_xlab and tm_ylab called space. When grid line labels are plotted outside the frame, it is set automatically to a value such that the axis titles are plotted near the grid line labels. So your code should work straight out-of-the-box.

All 4 comments

A basic reproducible example could help verify the result here.

A basic reproducible example could help verify the result here.

Hi @Robinlovelace

Here we go!

library(tmap)
data(World)
qtm(World, fill="#FFF8DC", projection="longlat") +
  tm_grid(col = "gray70", labels.inside.frame=F) +
  tm_xlab("Longitude") +
  tm_ylab("Latitude")

plot_zoom

Done! I've added an argument to tm_xlab and tm_ylab called space. When grid line labels are plotted outside the frame, it is set automatically to a value such that the axis titles are plotted near the grid line labels. So your code should work straight out-of-the-box.

Thank you @mtennekes !!!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mtennekes picture mtennekes  路  4Comments

marionowak picture marionowak  路  9Comments

Nowosad picture Nowosad  路  4Comments

jarsc568 picture jarsc568  路  8Comments

Robinlovelace picture Robinlovelace  路  4Comments