RE: [R] persp( ) Question

From: Martin Maechler <maechler_at_stat.math.ethz.ch>
Date: Sun 15 May 2005 - 00:25:11 EST

>>>>> "DavidB" == Brahm, David <David.Brahm@geodecapital.com>
>>>>> on Fri, 6 May 2005 14:16:19 -0400 writes:

    DavidB> Greg, Assign the output of "persp" to a variable     DavidB> "pmat":
    R> pmat <- persp(X.grid, Y.grid, pred.loess1, theta=0,     R> phi=12)

    DavidB> Now you can add points to your plot with the usual
    DavidB> "points" command.  But you have to translate your 3D
    DavidB> coordinates (x,y,z) into 2D coordinates for "points"
    DavidB> to understand, and that's what "trans3d" does:

    R> points(trans3d(x,y,z, pmat), col="red")

    DavidB> You supply the (x,y,z) values, of course.  It's a
    DavidB> mystery to me why "trans3d" is not included in the
    DavidB> graphics package (where "persp" lives).  HTH.

Yes, I had similar thoughts many weeks ago, and already then prepared to add to trans3d(). Will do this now (for R 2.2.0).

Martin



R-help@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 Received on Sun May 15 00:29:44 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:46 EST