2013-01-22 37 views

回答

22

這工作:

plot(r, axes=FALSE, box=FALSE) 

要了解怎麼可能已經發現,爲自己,有嘗試以下一起來看看底層功能。 (需要對showMethods()getMethod()的調用,因爲光柵包廣泛使用的方法S4而不是更常用的S3的方法。)

showMethods("plot") 
getMethod("plot", c("Raster", "ANY")) 
getAnywhere(".plotraster2") 
getAnywhere(".rasterImagePlot") 
args(raster:::.rasterImagePlot) 
# function (x, col, add = FALSE, legend = TRUE, horizontal = FALSE, 
#  legend.shrink = 0.5, legend.width = 0.6, legend.mar = ifelse(horizontal, 
#   3.1, 5.1), legend.lab = NULL, graphics.reset = FALSE, 
#  bigplot = NULL, smallplot = NULL, legend.only = FALSE, lab.breaks = NULL, 
#  axis.args = NULL, legend.args = NULL, interpolate = FALSE, 
#  box = TRUE, breaks = NULL, zlim = NULL, zlimcol = NULL, fun = NULL, 
#  asp, colNA = NA, ...) 
0

我建議最好是

plot(r,axes=F,useRaster=F) 

選項bty='n'通常擺脫了盒子,但光柵繪圖功能似乎上繪製自己的盒子常規盒子的頂部,你不能擺脫。