[R] control margin when plotting polygons?

Shengde Liang shengdel at biostat.umn.edu
Fri May 11 22:54:23 CEST 2007

Hello everyone,

I have some difficulties on controling the margin of a plot.
For example, the following code from the help of maptools:

xx <- readShapePoly(system.file("shapes/sids.shp", package="maptools")[1], 
IDvar="FIPSNO", proj4string=CRS("+proj=longlat +ellps=clrk66"))
plot(xx, border="blue", axes=TRUE, las=1)

There is a lot of white margin on the bottom and top of the plot and I 
want to get rid of it. I used option "usr", but it does not make any 

plot(xx, border="blue", axes=TRUE, las=1,usr=c(-85,-75,33,39))

Option "ylim" does not work either.

Anyone has any idea how to do it?

Thanks a lot.


Shengde Liang

More information about the R-help mailing list