Using projection with xlim / ylim in R with the "maps" package leads to an increase in the map

I use R with the maps / mapproject / maptools packages to build some maps and notice a behavior that seems intuitive to me and actually limits what I can do.

Drawing a map of Europe (with limits taken from ETRS89 / ETRS-LCC , therefore without Iceland, as well as cropped in the East) without indicating the projection:

library(maps)
map("world",xlim=c(-10.67,34.5),ylim=c(31.55,71.05), interior = T)

Map of Europe without directions

The result will be as expected, the limits are used, and the final map follows them.

The projection used by default by maps is determined using the help:

The default is to use a rectangular projection with the aspect ratio
chosen so that longitude and latitude scales are equivalent at the 
center of the picture.

This is not a good projection for my needs, I will use the LCC projection with parallels, as indicated in the link above links to spatial reference:

library(maps)
map("world",xlim=c(-10.67,34.5),ylim=c(31.55,71.05), interior = T, projection="lambert", parameters = c(45,65))
box()

Map of Europe with a specified projection

, ( ), .

, :

library(maps)
library(mapproj)
map("world",xlim=c(-10.67,34.5),ylim=c(31.55,71.05), interior = T, projection="lambert", parameters = c(45,65))
map.grid(cex=0.1 , col="grey30")
box()

Map of Europe with projection and grid LCC

, ( , , ), , ( - , , , ). , , , map().

: map/mapproj/maptools? xlim/ylim , (.. , ).

+4
2

, , " ", , . :

xlim=c(-10.6700,31.5500), ylim=c(34.5000,71.0500)

, , .

xlim, , map() , . ( 29-31 xlim), . boundary , .

, , , . , add=T. col="white" , , .
library(maps)
library(mapproj)
map("world",regions="(?!Russia|Morocco|Algeria|Tunisia|Turkey|Ukraine)",col="white",xlim=c(-10.6600,31.5500), ylim=c(34.5000,71.0500), interior=T, projection="lambert", parameters=c(10.44,52.775))
map("world",xlim=c(-10.6600,31.5500), ylim=c(34.5000,71.0500), interior=T, projection="lambert", parameters=c(10.44,52.775),add=T)
map.grid(cex=0.1, col="grey30")
box()

, - xlim ylim, . , , .

final schedule

+2

"map()" xlim ylim, , , . , xlim ylim , , , , . ( xlim ylim, ). , ( ). () "", , . , mapproj , , . ( ) .

( ):

mymap <- map("world",xlim=c(-10.6600,31.5500), ylim=c(34.5000,71.0500),  projection="lambert", parameters=c(10.44,52.775), plot=FALSE)

mymap $x mymap $y:

range(mymap$x, na.rm=TRUE)

plot(mymap), , .

, , , ,

plot(mymap, type="l", asp=1,xaxt="n",yaxt="n",xlab="",ylab="", xlim=c(-0.2,0.15), ylim=c(-0.75,-0.35))

, , , . "Asp = 1" - , .

+2

Source: https://habr.com/ru/post/1662018/


All Articles