%let gpath='.'; %let dpi=200; ods html close; ods listing gpath=&gpath image_dpi=&dpi; /*--Generate data for the series plot--*/ data series; format Date PrevDate Date9.; label A='Response' C='Color Response'; PrevDate=.; PrevA=.; do i=0 to 364; date='01jan2009'd+i; A = 10+ 3*sin(i/90+0.5) + 1*sin(3*i/90+0.7); B = 5+ 3*sin(i/90+0.5) + 1*cos(3*i/90+0.7); C = 10+ 3*cos(i/90+0.5) + 1*sin(3*i/90+0.7); output; PrevDate=date; PrevA=A; end; run; /*--Series Plot--*/ ods graphics / reset width=5in height=3in imagename='Series_Plot'; title 'Series Plot'; proc sgplot data=series; series x=date y=a; run; /*--Vector Plot--*/ ods graphics / reset width=5in height=3in imagename='Vector_Plot'; title 'Series Plot with Color Response by Date'; proc sgplot data=series subpixel noborder; vector x=date y=a / xorigin=Prevdate yorigin=preva noarrowheads lineattrs=(thickness=2); xaxis display=(noline noticks nolabel) grid; yaxis display=none grid; run; /*--Vector Plot with Height as Color Response--*/ ods graphics / reset width=5in height=3in imagename='Vector_With_Response_Color'; title 'Series Plot with Color Response by Date'; proc sgplot data=series subpixel noborder; vector x=date y=a / xorigin=Prevdate yorigin=preva noarrowheads colorresponse=a colormodel=(red yellow green) lineattrs=(thickness=2); xaxis display=(noline noticks nolabel) grid; yaxis display=none grid; run; /*--Vector Plot with independent Color Response--*/ ods graphics / reset width=5in height=3in imagename='Vector_With_Response_Color_C'; title 'Series Plot with Color Response by Date'; proc sgplot data=series subpixel noborder; vector x=date y=a / xorigin=Prevdate yorigin=preva noarrowheads colorresponse=c colormodel=(red yellow green) lineattrs=(thickness=10); xaxis display=(noline noticks nolabel) grid; yaxis display=none grid; run; /*--Vector Plot with independent Color Response Thick Line--*/ ods graphics / reset width=5in height=3in imagename='Vector_With_Response_Color_C_10'; title 'Series Plot with Color Response by Date'; proc sgplot data=series subpixel noborder; vector x=date y=a / xorigin=Prevdate yorigin=preva noarrowheads colorresponse=c colormodel=(red yellow green) lineattrs=(thickness=40); xaxis display=(noline noticks nolabel) offsetmin=0.1 offsetmax=0.1 grid; yaxis display=none grid offsetmin=0.1 offsetmax=0.1; run;