Fw: [R] Contour plot

Romain Francois francoisromain at free.fr
Tue Feb 8 20:57:09 CET 2005


Le 08.02.2005 17:43, dhkblaszyk at zeelandnet.nl a écrit :

>I understand that I need to have a (in this case) square matrix with all the
>data. But the question now is;
>
>- can the contourplot not interpolate the missing values
>
>  
>
I think it doesn't (see (1) below)

>or alternatively
>
>- I have fit a model to the z data (z = 100 + 0.5x + 0.5y). How can I make
>from this model a "square" matrix z to make a contour plot?
>
>  
>
Hello,

try something like that :

x <- y <- 1:10
z <- 100+0.5*outer(x,y,FUN="+")
contour(x,y,z)


(1) :
z[3:4,3:4] <- NA #putting some missing values
contour(x, y, z,nlevels=20)



Romain.

>>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
>>>
>>>      
>>>
>
>______________________________________________
>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
>
>
>  
>


-- 
Romain FRANCOIS : francoisromain at free.fr
page web : http://addictedtor.free.fr/  (en construction)
06 18 39 14 69 / 01 46 80 65 60
_______________________________________________________
Etudiant en 3eme année
Institut de Statistique de l'Université de Paris (ISUP)
Filière Industrie et Services
http://www.isup.cicrp.jussieu.fr/




More information about the R-help mailing list