Re: [R] Is there a way to draw 3d plot?

From: Uwe Ligges <ligges_at_statistik.uni-dortmund.de>
Date: Fri 26 May 2006 - 17:23:51 EST

Michael wrote:

> Hi all,
>
> I have a 2D matrix, which has 100 rows, and 100 columns,
>
> I have a 2D matrix, with 100 rows and 100 columns,
>
> I want to display it using 3D plot, much like plot3d and mesh/surf functions
> in matlab.
>
> Specifically, in matlab, I just need to do the following:
>
> --------
> [X, Y]=meshgrid([0:0.01:0.99, 0:0.01:0.99]);
> % Z is my 2D matrix,
> surf(X, Y, Z);
> --------
>
> Note that X and Y are created so that I can associate physical meaning onto
> the x and y axis of the 3D plot.
>
> For example, my 100 rows represent 0, 0.01, 0.02, ... 0.99 here.
>
> In Matlab I can also drag in the graphic window and see from different
> visual angle and perspective of the 3D plot...
>
> Are there similar functions in R that (1) show 3D plot; (2) let me
> manipulate view angles easily?

(1) See ?persp

(1) *and* (2): See package "rgl".

Uwe Ligges

> Thanks a lot!
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> 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



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 Fri May 26 17:27:18 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 26 May 2006 - 18:10:26 EST.

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