Set plot margin of png plot device using par
问题 I've created a choropleth of Brazil. When saving the plot in .png, the upper and the lower part of the plot are lost (covered). Here are the lines to save the plot. plot.new() par(omi=c(0,0,0,0), mgp=c(0,0,0),mar=c(0,0,0,0) , family = "D") par(mfrow=c(1,1),cex=1,cex.lab = 0.75,cex.main=0.2,cex.axis=0.2) png(filename = "map_cons_g.png", width = 6,height = 6, units = "in", res = 600) plot(c(-75,-35),c(0,-30),type="n",axes=FALSE,xlab="",ylab="",asp=1.2) plot(Brazil,col=cols[Brazil$Cons.g_ri],add