Categorical Heat Map (GPL)

Figure 1. GPL for categorical heat map
* Open sample file Employee Data.sav.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=gender educ salary
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
  SOURCE: s=userSource(id("graphdataset"))
  DATA: gender = col(source(s), name("gender"), unit.category())
  DATA: educ = col(source(s), name("educ"), unit.category())
  DATA: salary = col(source(s), name("salary"))
  GUIDE: axis(dim(1), label("Educational Level"))
  GUIDE: axis(dim(2), label("Gender"))
  GUIDE: legend(aesthetic(aesthetic.color), label("Mean Salary"))
  ELEMENT: point(position(educ*gender), shape(shape.square), size(size."10%"), 
                 color(summary.mean(salary)))
END GPL.
Figure 2. Categorical heat map
Categorical heat map
Figure 3. GPL for alternate categorical heat map
* Open sample file Employee Data.sav.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=gender educ salary
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
  SOURCE: s=userSource(id("graphdataset"))
  DATA: gender = col(source(s), name("gender"), unit.category())
  DATA: educ = col(source(s), name("educ"), unit.category())
  DATA: salary = col(source(s), name("salary"))
  GUIDE: axis(dim(1), label("Educational Level"))
  GUIDE: axis(dim(2), label("Gender"))
  GUIDE: legend(aesthetic(aesthetic.color), label("Mean Salary"))
  ELEMENT: polygon(position(educ*gender), color(summary.mean(salary)))
END GPL.
Figure 4. Alternate categorical heat map
Alternate categorical heat map