[R] contour and filled contour plots

Romain François francoisromain at free.fr
Fri Jan 14 23:42:09 CET 2005


Hello again,

look at the data provided by d, it's a list with:
- x  : the 1st coordinate
- y : the 2nde coordinate
- z : a matrix of dimension 25 x 25 (the rectangles shown by image are
the representation of those 625 points, the contour
function uses interpolation.

See the n parameter in kde2d function, if you specify n=100, you won't
be able to see the rectangles, and that will be as pretty as you want.

Hope that clarify a bit.

Romain

m p a écrit :

>Thanks, but this does not work correctly.
>Contour lines with "contour"  do not coincide
>with those produced by "image". Also "image" plots 
>contour lines with right angles while "contour" plots
>contour lines taking the diagonal between neighboring
>points. All looks quite ugly.
>If there are options to make them coincide I would
>like to hear about them since I can't find them.
>BTW: is it possible to change labeling og color
>bar for filled.contour?
>Mark   
>
>--- Romain François <francoisromain at free.fr> wrote:
>
>  
>
>>You might want to try ?image like in :
>>
>>require(MASS)
>>x <- rnorm(50)
>>y <- rnorm(50)
>>d <- kde2d(x,y)
>>image(d,col=terrain.colors(50))
>>contour(d,add=T)
>>
>>
>>Hope this is what you are looking for.
>>Romain.
>>
>>
>>m p a écrit :
>>
>>    
>>
>>>Hello,
>>>I'd like to remove color bar from "filled.contour"
>>>plot.
>>>Is it possible and how?
>>>I also want to overlay "contour" plot on
>>>filled.contour
>>>but due to scaling of the "filled.contour" to
>>>account for the color bar, aspect ratio for
>>>      
>>>
>>"contour"
>>    
>>
>>>is different from "filled.contour". Can this
>>>      
>>>
>>problem
>>    
>>
>>>be solved?
>>>Thanks,
>>>Mark
>>>
>>> 
>>>
>>>      
>>>

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