Re: [R] Axes limits in rgl.surface.

From: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: Mon, 17 Dec 2007 15:07:03 -0500

On 12/17/2007 2:29 PM, Todd Remund wrote:
> I have looked through the documentation and have not been able to find a way of using an xlim, ylim, or zlim type option on rgl.surface. I know that persp3d has the option, but seems to only be able to expand the axes not reduce them. Is there anyone who has an idea of how to do this? Thank you for your time.

You'll need to do the trimming yourself. There isn't currently any support for user-controlled clipping regions in rgl.

That is: for the usual case where x and y are vectors, to limit x or y to a certain range, just take a subset of those values, and a subset of the rows or columns of z. To limit the range of z, set out of range entries to NA. It will probably look ugly because it will get a very ragged edge.

It appears that the NA handling for the case where x or y is a matrix leaves something to be desired.

Duncan Murdoch



R-help_at_r-project.org 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. Received on Mon 17 Dec 2007 - 20:12:20 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 17 Dec 2007 - 20:30:19 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.