ods html close; %let gpath=C:\; %let w=5in; %let h=2.5in; %let dpi=200; ods listing gpath="&gpath" image_dpi=&dpi; data weather; input Month $ High Low Precip; Mean=(high+low)/2; label high= 'High'; label low = 'Low'; label precip= 'Precipitation'; label mean='Temperature'; format high low 2.0; datalines; Apr 71 48 2.98 May 78 57 4.03 Jun 84 65 4.06 Jul 88 69 4.35 Aug 86 68 4.30 Sep 80 62 4.27 Oct 70 49 3.28 Nov 61 42 3.06 Dec 52 33 3.25 Jan 49 30 4.46 Feb 53 32 3.53 Mar 61 40 4.46 ; run; ods escapechar '~'; ods graphics / reset width=&w height=&h imagename='Margin'; title "Average Monthly Temperature (~{Unicode '00b0'x}F) and Precipitation (in)"; proc sgplot data=weather; highlow x=month low=low high=high / lineattrs=(thickness=2); xaxistable high low precip / location=inside; xaxis display=(nolabel); yaxis display=(noline nolabel); run; ods graphics / reset width=&w height=&h imagename='Margin_Ref'; title "Average Monthly Temperature (~{Unicode '00b0'x}F) and Precipitation (in)"; proc sgplot data=weather noborder; highlow x=month low=low high=high / lineattrs=(thickness=2); refline 'Dec' / axis=x discreteoffset=0.5; xaxistable high low precip month / location=inside labelattrs=(size=8); xaxis display=none; yaxis display=(noline nolabel); run; ods graphics / reset width=&w height=&h imagename='Margin_Ref2'; title "Average Monthly Temperature (~{Unicode '00b0'x}F) and Precipitation (in)"; proc sgplot data=weather noborder; highlow x=month low=low high=high / lineattrs=(thickness=2); refline 'Dec' / axis=x discreteoffset=0.5; xaxistable high low precip month / location=inside labelattrs=(size=8); xaxis display=(noline nolabel noticks novalues) colorbands=odd colorbandsattrs=(transparency=1); yaxis display=(noline nolabel noticks) grid offsetmin=0.05; run; /*--Weather data with obs < 4" precip--*/ data weather2; set weather; if precip < 4 then ref=month; run; %let verylightblue=cxd0e0f0; /*--9.40M5 adhoc bands--*/ ods graphics / reset width=&w height=&h imagename='Margin_Discrete_Ref_940m5'; title "Average Monthly Temperature (~{Unicode '00b0'x}F) and Precipitation (in)"; proc sgplot data=weather2 noborder; refline ref / axis=x discretethickness=1 lineattrs=(color=&verylightblue); highlow x=month low=low high=high / lineattrs=(thickness=2); xaxistable high low precip month / location=inside labelattrs=(size=8); xaxis display=(noline nolabel noticks novalues); yaxis display=(noline nolabel noticks) grid; run; /*--9.40M5 adhoc bands--*/ ods graphics / reset width=&w height=&h imagename='Margin_Discrete_Ref_2_940m5'; title "Average Monthly Temperature (~{Unicode '00b0'x}F) and Precipitation (in)"; proc sgplot data=weather2 noborder; refline ref / axis=x discretethickness=1 lineattrs=(color=&verylightblue); highlow x=month low=low high=high / lineattrs=(thickness=2); xaxistable high low precip month / location=inside labelattrs=(size=8); xaxis display=(noline nolabel noticks novalues) colorbands=odd colorbandsattrs=(transparency=1); yaxis display=(noline nolabel noticks) grid; run;