简体   繁体   中英

PNG image without border/frame in R?

I am trying to produce a png file that has no black frame around. I know how it works with the plot command, but I cannot find any solution using png() or image(). These are the command lines of concern:

png(filename = paste(outDir,"/PRCP",yy0,mm0,dd0,"+",sprintf("%03.0f",(lt*6)),"h_temp.png",sep=""), width = (dPm[2]), height = (dPm[1]), bg = "transparent")
par(mai=c(0,0,0,0))
image(Dem[,dPm[1]:1],col=grey((13:0)/15),useRaster = TRUE, add = FALSE,zlim=range(Dem,na.rm=TRUE))
dev.off()

Has anybody an advice?

ok, after trying many many different options (unsuccessful), I finally found it out. If you use image(), then you have to put axes=FALSE in order to not get a frame

PS: thanks for all the help offered!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM