Stacked Histogram (GPL)

Figure 1. GPL for stacked histogram
* Open sample file Employee Data.sav.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=salary gender
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
  SOURCE: s=userSource(id("graphdataset"))
  DATA: salary=col(source(s), name("salary"))
  DATA: gender=col(source(s), name("gender"), unit.category())
  GUIDE: axis(dim(2), label("Count"))
  GUIDE: axis(dim(1), label("Salary"))
  ELEMENT: interval.stack(position(summary.count(bin.rect(salary))),
                          color(gender))
END GPL.
Figure 2. Stacked histogram
Stacked histogram