SPSS ggraph code for transparent overlay histogram

17 Views Asked by At

I tried to plot two histograms for two variables (ordinal, same structure) in one panel using ggraph commands in SPSS v28. What's wrong with this code that I only get the second element plotted?

* Chart Builder.
GGRAPH
  /GRAPHDATASET NAME="graphdataset" VARIABLES=male_effort female_effort MISSING=LISTWISE 
    REPORTMISSING=NO 
  /GRAPHSPEC SOURCE=INLINE.
BEGIN GPL
  SOURCE: s=userSource(id("graphdataset"))
  DATA: male_effort=col(source(s), name("male_effort"))
  DATA: female_effort=col(source(s), name("female_effort"))
  GUIDE: axis(dim(1), label("Effort"))
  GUIDE: axis(dim(2), label("Frequency"))
 ELEMENT: interval(position(summary.count(bin.rect(male_effort))), color(color.green), transparency.interior(transparency."0.4")))
 ELEMENT: interval(position(summary.count(bin.rect(female_effort))), color(color.blue), transparency.interior(transparency."0.9")))
END GPL.

Changes on the Element-commands did not work out to solve the problem.

0

There are 0 best solutions below