Figure 1. GPL for binned scatterplot with polygons
* Open sample file Employee Data.sav.
GGRAPH
/GRAPHDATASET NAME="graphdataset" VARIABLES=salbegin salary
/GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
SOURCE: s=userSource(id("graphdataset"))
DATA: salbegin=col(source(s), name("salbegin"))
DATA: salary=col(source(s), name("salary"))
GUIDE: axis(dim(2), label("Current Salary"))
GUIDE: axis(dim(1), label("Beginning Salary"))
GUIDE: legend(aesthetic(aesthetic.color), label("Count"))
ELEMENT: polygon(position(bin.hex(salbegin*salary, dim(1,2))),
color(summary.count()))
END GPL.
Figure 2. Binned scatterplot with polygons