Scatterplot with Border Histograms (GPL)

Figure 1. GPL for scatterplot with border histograms
* Open sample file Employee Data.sav.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=salary salbegin
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
  SOURCE: s=userSource(id("graphdataset"))
  DATA: salary = col(source(s), name("salary"))
  DATA: salbegin = col(source(s), name("salbegin"))
  GRAPH: begin(origin(5%, 10%), scale(85%, 85%))
  GUIDE: axis(dim(1), label("Beginning Salary"))
  GUIDE: axis(dim(2), label("Current Salary"))
  ELEMENT: point(position(salbegin*salary))
  GRAPH: end()
  GRAPH: begin(origin(5%, 0%), scale(85%, 10%))
  GUIDE: axis(dim(1), ticks(null()))
  GUIDE: axis(dim(2), null())
  ELEMENT: interval(position(summary.count(bin.rect(salbegin))))
  GRAPH: end()
  GRAPH: begin(origin(90%, 10%), scale(10%, 85%))
  COORD: rect(dim(1, 2), transpose())
  GUIDE: axis(dim(1), ticks(null()))
  GUIDE: axis(dim(2), null())
  ELEMENT: interval(position(summary.count(bin.rect(salary))))
  GRAPH: end()
END GPL.
Figure 2. Scatterplot with border histograms
Scatterplot with border histograms