[R] Draw a circle on a filled.contour() plot

Webmaster webmaster at citedesjeunes.com
Sun Dec 17 13:06:20 CET 2006


Hi all,

I'm trying to use symbols() to draw a circle of a given radius at a  
given position onto a filled.contour() plot. The commands I issue are:

> filled.contour(y,x,z,levels=seq 
> (0.02,1.0,len=50),color.palette=colorRampPalette(c 
> ("blue","yellow","red")),title=title(main="",xlab="",ylab=""))
> symbols(0.62,0.0,circles=c(2.5),add=TRUE,inches=FALSE

As can be seen on the resulting PDF file (http://www.eleves.ens.fr/ 
home/coudert/hist_2d.pdf), the circle appears to have the right  
radius but its center is not the correct one [0.62, 0]. What am I  
missing here?

Thanks for your help,
FX

PS: complete input (5 lines), data file for the contour plot and PDF  
result on my system can be found at:
Data file: http://www.eleves.ens.fr/home/coudert/hist_2d
R script: http://www.eleves.ens.fr/home/coudert/hist_2d.R
PDF result: http://www.eleves.ens.fr/home/coudert/hist_2d.pdf



More information about the R-help mailing list