When you have 3 dimensions, you don’t get a line, you get a plane. GPL will generate a lattice plain (not solid). I think that this was added in Release 17. This syntax works as described for release 19:
GGRAPH
/GRAPHDATASET NAME="graphdataset" VARIABLES=horse mpg weight MISSING=LISTWISE REPORTMISSING=NO
/GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
SOURCE: s=userSource(id("graphdataset"))
DATA: horse=col(source(s), name("horse"))
DATA: mpg=col(source(s), name("mpg"))
DATA: weight=col(source(s), name("weight"))
COORD: rect(dim(1,2,3))
GUIDE: axis(dim(1), label("Vehicle Weight (lbs.)"))
GUIDE: axis(dim(2), label("Horsepower"))
GUIDE: axis(dim(3), label("Miles per Gallon"))
ELEMENT: point(position(weight*horse*mpg))
ELEMENT: line(position(smooth.linear(weight*horse*mpg)), color(color.white), size(size."1px"))
END GPL.
It uses the sample Cars.sav data file.
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Chris Hunt
Sent: Monday, October 11, 2010 2:46 AM
To: [hidden email]
Subject: 3D plots
Does anybody know if it is possible to draw a regression line on a 3D scatter-plot?
Thanks,
Chris