tmap icon indicating copy to clipboard operation
tmap copied to clipboard

Alignment lowercase / uppercase position

Open statnmap opened this issue 4 years ago • 1 comments

I think I am missing something with lowercase/uppercase position.
Documentation says it depends on margins, but this does not seem to be inner.margins. I was hoping that the alignment accounted for inner.margins, as lowercase position is aligned with the map, and uppercase, aligned with the box.
Instead, there is a small difference in position due to a type of margin it seems I can not control.

I can see the small difference between both the images below, but I do not get why it is not the last image that is true.

library(tmap)
data("World")

tm_shape(World) +
    tm_polygons("HPI") +
  tm_layout(
    inner.margins = c(0, 0.5, 0, 0.1),
    title = "My title",
    title.position = c("left", "TOP")
  )

image

tm_shape(World) +
    tm_polygons("HPI") +
  tm_layout(
    inner.margins = c(0, 0.5, 0, 0.1),
    title = "My title",
    title.position = c("LEFT", "TOP")
  )

image

What I expected: lowercase aligned with the map extent.

library(tmap)
data("World")

tm_shape(World) +
    tm_polygons("HPI") +
  tm_layout(
    inner.margins = c(0, 0.5, 0, 0.1),
    title = "My title",
    title.position = c("left", "TOP")
  )

000003

statnmap avatar Sep 27 '21 16:09 statnmap

I think the difference between lower and upper case is a hard-coded margin, that has nothing to do with inner.margins. I'm not planning to change this in v3, unless there is an easy-to-fix bug somewhere.

What would you like to achieve?

I cannot see any difference between the first and the last code chunk.

mtennekes avatar Oct 01 '21 19:10 mtennekes

@statnmap feel free to reopen the issue if needed

Nowosad avatar Feb 18 '23 19:02 Nowosad