The solution is to NOT define the column axis within layout lattice. Rather, define it exactly the same for both lattice overlays. I turned the display=NONE option for the histogram.
proc template; define statgraph Fig_5_4_3; dynamic VAR VARLABEL; begingraph /DesignWidth=650px; entrytitle "&year Widget Contracts ($/unit)" ; layout lattice / columndatarange=union rowweights=(0.8 0.2) columndatarange=union rowgutter=2px; layout overlay /yaxisopts=(griddisplay=on) xaxisopts=(display=NONE linearopts=(includeranges=(0-220 310-330) ) ) ; histogram PayerCF / nbins=40 binaxis=false; densityplot PayerCF / lineattrs=graphfit name='n' legendlabel='Normal';
layout gridded /columns=2 border=TRUE autoalign=(TopLeft); entry halign=left "N"; entry halign=left eval(strip(put(n(VAR),comma6.))); entry halign=left "Mean"; entry halign=left eval(strip(put(mean(VAR),dollar6.2))); entry halign=left "Median"; entry halign=left eval(strip(put(median(VAR),dollar6.2))); endlayout; endlayout; layout overlay / yaxisopts=(griddisplay=on) xaxisopts=(display=(LINE TICKS TICKVALUES) linearopts=(includeranges=(0-220 310-330) tickvalueformat=dollar4. tickvaluelist=(0 20 40 60 80 100 120 140 160 180 200 220 320) ) ) ; boxplot y=PayerCF /orient=horizontal meanattrs=(color=navy size=10 symbol=diamondfilled) dataskin=GLOSS display=(CAPS FILL MEAN MEDIAN ) extreme=true ; endlayout; endlayout; endgraph; end; run;
... View more