andysouth / rworldmap

R package for mapping country data
29 stars 7 forks source link

mapCountryData aspect defaults to 1, causing ylim to be ignored #11

Open ilario opened 5 years ago

ilario commented 5 years ago

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