[R] Contour plot

Achim Zeileis Achim.Zeileis at wu-wien.ac.at
Tue Feb 8 01:51:57 CET 2005


On Tue, 8 Feb 2005 01:15:06 +0100 dhkblaszyk at zeelandnet.nl wrote:

> Hello,
> 
> I would like to make a contourplot of the following data;
> 
> > x <- 1:10
> > y <- 1:10
> > z <- 100:110
> 
> By doing >contour(x,y,z) I get the following error;
> 
> "Error in contour.default(x, y, z) : no proper `z' matrix specified"
> 
> How do I fix this??

x and y specify a grid and thus z must provide a value for each
combination of the x's and y's! For example:
  x <- y <- 1:10
  contour(x, y, outer(x, y))
Also look at 
  outer(x, y)
and read ?contour.

Z

> Kind regards, Datius Blaszijk
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> 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
>




More information about the R-help mailing list