{"word_count": 154, "character_count": 1292}
In cartography several functions have a pos or legend.pos argument. These arguments can take the following values: "topleft", "top", "topright", "right", "bottomright", "bottom", "bottomleft", "bottomleftextra", "left" or a vector of two coordinates in map units (c(x, y)).The posibility to use a vector of coordinates is useful for placing an element at a precise location:library(sf)library(cartography)mtq &#60;- st_read(system.file("gpkg/mtq.gpkg", package="cartography"))png("poslegend1.png", width = 474, height = 555)par(mar = c(0,0,0,0))plot(st_geometry(mtq))# precise location of the bottomleft corner of the legendlegpos &#60;- c(717200, 1637100)points(x = legpos[1], y = legpos[2], pch = 4)propSymbolsLayer(x = mtq, var = "POP",                  legend.pos = legpos)dev.off()The locator() function allows users of an interactive R session to click on a graphic device to obtain coordinates of the cursor in the device's coordinate reference system:One can take advantage of this function to interactively position legends and layout elements on a map with cartography using unlist(locator(1)) as input for pos or legend.pos:[caption id="attachment_1947" align="aligncenter" width="474"] code for the figure: https://gist.github.com/rCarto/3a8255bb2ee2dae299a5ae13925e0cd3[/caption]