[R] Partial wireframe plots

Prof Brian Ripley ripley at stats.ox.ac.uk
Mon Jan 10 13:23:26 CET 2005


On Mon, 10 Jan 2005, Rob Knell wrote:

> Can anyone direct me to a method for plotting what you might call a partial 
> wireframe plot? I have two explanatory variables in a dataset which give me a 
> significant interaction term when I fit a model. The two variables are 
> correlated with each other to a moderate degree, and if I plot the predicted 
> values from the model as a surface in a 3D wireframe plot there are some 
> quite large parts of the surface that don't actually represent reasonable 
> values for both variables. I'd like to only plot the parts of the surface 
> that correspond to values of X and Y that are present in my dataset, which 
> would give a surface with some corners missing. I can't see any way of 
> specifying parts of the grid that should not be drawn: can anyone enlighten 
> me? Alternatively, is it possible to shade specified squares of the plot to 
> indicate the important parts of it?

Note what ?persp says about NA values: I believe wireframe (lattice) does 
the same thing, that is only plot the grid over the region of finite 
(non-NA, non-Inf) values, at least provided it is a sensible shape.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list