home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Tools / Languages / RLaB 1.15c / doc / 3d.r < prev    next >
Encoding:
Text File  |  1994-05-31  |  320 b   |  19 lines  |  [TEXT/????]

  1. // Create the data
  2. X = -2:2:.2;
  3. Y = X;
  4. Z = [];
  5. for (i in 1:X.n) { 
  6.   for (j in 1:Y.n) { 
  7.     Z[i;j] = X[i] * exp (-X[i]^2 - Y[j]^2);
  8.   }
  9. }
  10. // Make the plot
  11. pstart(,,"xwin");
  12. plwid(4);
  13. ptitle("Sample 3-D Plot");
  14. xlabel("X-Axis");
  15. ylabel("Y-Axis");
  16. zlabel("Z-Axis");
  17. plmesh( << x = X; y = Y; z = Z >> );
  18. plprint("3d.ps");
  19.