[R-sig-Geo] White space in maps library

Frede Aakmann Tøgersen FredeA.Togersen at agrsci.dk
Mon Apr 21 08:30:13 CEST 2008


Well, it has something to do with with the dimensions of the png. The default height and width is 480 pixels. 

Try

png("test.png", width = 960)
par(mar=c(5,5,0,0))
map('world', xlim=c(-125,-50),ylim=c(25,50))
map.axes()
dev.off()

where I have used the mar-settings of par() too. See ?par.

Med venlig hilsen
Frede Aakmann Tøgersen
 

 

> -----Oprindelig meddelelse-----
> Fra: r-sig-geo-bounces at stat.math.ethz.ch 
> [mailto:r-sig-geo-bounces at stat.math.ethz.ch] På vegne af 
> Brian J. Lopes
> Sendt: 21. april 2008 01:41
> Til: r-sig-geo at stat.math.ethz.ch
> Emne: [R-sig-Geo] White space in maps library
> 
> Hey All,
> 
> I have a quick question regarding the maps package, and I'm 
> not sure what I'm missing.
> 
> Let's say I just want a plot of the US, by using the world 
> data and to save it as a png
> 
> library(maps)
> png("test.png")
> map('world', xlim=c(-125,-50),ylim=c(25,50))
> map.axes()
> dev.off()
> 
> The limits are actually important for me, so that's why I'm 
> not using 'usa'.  As you can see by looking at the png file, 
> there is a lot of excess white space both above and below the 
> file, I guess this has to do with the dimensions of the png 
> file, but setting the dimensions in the
> png() function doesn't seem to help the matter.
> 
> Any advice on how to deal with this?
> 
> TIA,
> Brian
> 
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
> 




More information about the R-sig-Geo mailing list