! Example with multiple scatter plots. ! Author: Francois Tonneau ! Data and figure from Sokolowski and Tonneau: Perspectives on Behavior Science ! (2021) 44:621–640 ! https://doi.org/10.1007/s40614-021-00321-y size 14 13 set font ss hei 0.3 sub hist index gsave begin graph size 1.75 1.75 fullsize xaxis min 0 max 10 ftick 0 dticks 10 yaxis min 0 max 0.2 ftick 0 dticks 0.1 format "fix 2" x2axis off y2axis off xside off xtitle Grade adist 0.4 ytitle Proportion adist 1.1 labels hei 0.3 ticks length -0.1 subticks length -0.075 data eval("hist_" + index + ".dat") d1 line hist end graph grestore end sub sub scatter index gsave begin graph size 1.75 1.75 fullsize xaxis min 0 max 10 ftick 0 dticks 10 yaxis min 0 max 10 ftick 0 dticks 10 x2axis off y2axis off xtitle Grade adist 0.4 ytitle Grade adist 0.5 labels hei 0.3 ticks length -0.1 subticks length -0.075 data wholeset.dat & d1=c1,c2 d2=c1,c3 d3=c1,c4 & d4=c2,c3 d5=c2,c4 & d6=c3,c4 d[index] marker fcircle msize 0.02 let d9 = intercept+(slope*x) end graph amove xg(0) yg(0) aline xg(10) yg(10) grestore end sub ! Draw histograms along the diagonal. amove 1.75 10 hist 1 rmove 3 -3 hist 2 rmove 3 -3 hist 3 rmove 3 -3 hist 4 ! Draw first row of scatterplots. amove 4.75 10 scatter 1 rmove 3 0 scatter 2 rmove 3 0 scatter 3 ! Draw second row of scatterplots. rmove -3 -3 scatter 4 rmove 3 0 scatter 5 ! Draw scatterplot on third row. rmove 0 -3 scatter 6 ! Add column and row numbers. set hei 0.4 just bc amove 2.65 12.15 write 1 rmove 3 0 write 2 rmove 3 0 write 3 rmove 3 0 write 4 ! set just cl rmove 1.3 -1.1 write 1 rmove 0 -3 write 2 rmove 0 -3 write 3 rmove 0 -3 write 4