[R-sig-Geo] plot.im annoyances

Quets Jan Jan.Quets at ua.ac.be
Mon Dec 12 14:27:04 CET 2011


Hello all,

I have several issues with using plot.im to plot a density map.

4 images are can be found here:

http://www.ua.ac.be/main.aspx?c=jan.quets&n=74655&ct=69642

and the codes that produced them are printed below in this mail:

the issues are:

1) cex.main doesn't work, cannot scale font of title

2) setting margins with mar=c(x,x,x,x) does not seem to work as it should: from image1 to image 4 I made attempts to include both title and text below the plot visible
		a) in image1 and image4, the title is topped of, because it is not completely inside the box; at image2 and3 the title is completely outside the box, yet visible (???)
		b) the first and third entry in mar=c(x,x,x,x), should refer to bottom and top, but when you look at image3, the opposite is true (margins get wider left and right)
		c) when I (because of b)) increase the second and third entry in mar=c(x,x,x,x) to increase bottom and top margins, it worked, but the title also heightens together with the margin, so that it is still not completely visible 

3) uninvited white lines traversing plot area

4) axes=FALSE didn't work, ticks and labels on the ribbon are still there

5) while not setting axes=FALSE, I tried to increase the font size of the ribbon labels with, cex.axis=3, but that didn't work either


could someone enlighten be what is going on?

kind regards,
Jan
---------------------------------------------------------------------------------------------------------
#code image1.jpg

jpeg("./output/densmap.jpg", width = 8, height = 8*aspect, units="in",res=50)
	par(mar=c(0,0,0,0))
	plot(densim,ribscale=1/(mpp^2),ribsep=0.05,axes=FALSE,main=paste("density map"),cex.main=5);box();
	text(4000,-150,labels=paste("kernel's standard deviation: ",round(attr(densim,"sigma")*mpp,2)," m"),cex=2)
dev.off()

#code image2.jpg

jpeg("./output/densmap.jpg", width = 8, height = 8*aspect, units="in",res=50)
	par(mar=c(0,0,5,0))
	plot(densim,ribscale=1/(mpp^2),ribsep=0.05,axes=FALSE,main=paste("density map"),cex.main=5);box();
	text(4000,-150,labels=paste("kernel's standard deviation: ",round(attr(densim,"sigma")*mpp,2)," m"),cex=2)
dev.off()

#code image3.jpg

jpeg("./output/densmap.jpg", width = 8, height = 8*aspect, units="in",res=50)
	par(mar=c(5,0,5,0))
	plot(densim,ribscale=1/(mpp^2),ribsep=0.05,axes=FALSE,main=paste("density map"),cex.main=15);box();
	text(4000,-150,labels=paste("kernel's standard deviation: ",round(attr(densim,"sigma")*mpp,2)," m"),cex=2)
dev.off()

#code image4.jpg

jpeg("./output/densmap.jpg", width = 8, height = 8*aspect, units="in",res=50)
	par(mar=c(0,5,0,5))
	plot(densim,ribscale=1/(mpp^2),ribsep=0.05,axes=FALSE,main=paste("density map"),cex.main=15);box();
	text(4000,-150,labels=paste("kernel's standard deviation: ",round(attr(densim,"sigma")*mpp,2)," m"),cex=2)
dev.off()



More information about the R-sig-Geo mailing list