[R] x-axis in filled.contour

Greg Snow Greg.Snow at intermountainmail.org
Fri Jan 19 17:51:30 CET 2007

The filled.contour function first plots the contour plot, then the
legend to the side.  The plotting parameters that are in effect after
the call are based on the legend, not the original plot, so the
coordinate system apears to be messed up.  One way around this is to use
the plot.axis argument to do your annotation, look at the example in
?filled.contour that is labelled  # Annotating a filled contour plot

Hope this helps,

Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at intermountainmail.org
(801) 408-8111

> -----Original Message-----
> From: r-help-bounces at stat.math.ethz.ch 
> [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Thomas Steiner
> Sent: Friday, January 19, 2007 8:56 AM
> To: r-help at stat.math.ethz.ch
> Subject: [R] x-axis in filled.contour
> The filled.contour function gives me some strange output. 
> What did I do wrong?
> x=seq(0,1,length=10)
> y=seq(0,1,length=10)
> z=array(rnorm(100),dim=c(10,10))
> filled.contour(x,y,z)
> lines(0.4,0.8,type="p")
> abline(v=0.4,lty="dashed")
> the x-cooridnate of the line and the point is 0.4, but it's 
> slightly above. This problem just appears with 
> "filled.contour", so I guess there is a problem with the key 
> on the right.
> I use 2.4.0 under unbuntu
> Thomas
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

More information about the R-help mailing list