[R-sig-Geo] plotRGB and graphical parameters

Gareth Davies grothered at gmail.com
Thu Mar 21 02:48:30 CET 2013


Hi Hannah,
One work-around is to avoid plotting the axes at first, and then add 
them later.
Because plotRGB takes up the margins of the graphics device, you have to 
explicitly add in margins to get this to work

Example:

###
library(raster)
b <- brick(system.file("external/rlogo.grd", package="raster"))
par(oma=c(3,3,3,3)) # Add margins
plotRGB(b, 3, 2, 1,axes=F,main="test")
axis(side=1,cex.axis=2)
axis(side=2,las=0,cex.axis=2)
###

In my experience, forcing the axis parameters in the axis function will 
work.


Cheers,
G.



More information about the R-sig-Geo mailing list