Population Pyramid (GPL)

Figure 1. GPL for population pyramid
* Open sample file Employee Data.sav.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=gender salary
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
  SOURCE: s=userSource(id("graphdataset"))
  DATA: gender = col(source(s), name("gender"), unit.category())
  DATA: salary = col(source(s), name("salary"))
  COORD: transpose(mirror())
  GUIDE: axis(dim(1), label("Current Salary"))
  GUIDE: axis(dim(1), label(""), opposite())
  GUIDE: axis(dim(2), label("Frequency"))
  GUIDE: axis(dim(3), label("Gender"), opposite(), gap(0px))
  GUIDE: legend(aesthetic(aesthetic.color.interior), null())
  ELEMENT: interval(position(summary.count(bin.rect(salary*1*gender))), color(gender))
END GPL.
Figure 2. Population pyramid
Population pyramid