EXAMPLE 6  Overlay G3D Surfaces

Purpose: Overlay multiple 3D surfaces in the same plot.

One of the limitations of the SAS/GRAPH PROC G3D surface plot is that it allows you to plot only a single surface. A colleague in grad school had a need to plot two surfaces on the same set of axes, and I devised a way to do that using PROC GREPLAY. The technique is fairly straightforward, but there are a few caveats.

The data is not really important (you’ll have your own data); therefore, I use the following data, which I borrowed from a SAS/GRAPH example:

data raw_data;
input X Y Z;
datalines;
-1.0 -1.0   15.5
 -.5 -1.0   18.6
  .0 -1.0   19.6
  .5 -1.0   18.5
 1.0 -1.0   15.8
-1.0  -.5   10.9
 -.5  -.5   14.8
  .0  -.5   16.5
  .5  -.5   14.9

Get SAS/GRAPH: Beyond the Basics now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.