rworldmap icon indicating copy to clipboard operation
rworldmap copied to clipboard

mapCountryData aspect defaults to 1, causing ylim to be ignored

Open ilario opened this issue 6 years ago • 0 comments

I was looking for a way to plot the world map except for antartica and I realized that setting ylim in mapCountryData gets ignored unless aspect is set to "variable". In my opinion the default value for aspect should be changed from 1 to "variable" or this point should be underlined in the documentation of ylim option.

For example compare this:

data("countryExData",envir=environment(),package="rworldmap")
s <- joinCountryData2Map(countryExData, joinCode = "ISO3", nameJoinColumn = "ISO3V10")
mapCountryData(s, nameColumnToPlot="LAT", xlim=c(-180,180), ylim=c(-60,80))

with this:

data("countryExData",envir=environment(),package="rworldmap")
s <- joinCountryData2Map(countryExData, joinCode = "ISO3", nameJoinColumn = "ISO3V10")
mapCountryData(s, nameColumnToPlot="LAT", xlim=c(-180,180), ylim=c(-60,80), aspect="variable")

Thanks for the help

ilario avatar Oct 23 '18 13:10 ilario