%let gpath='C:\'; %let dpi=200; data ice; input Year Low Diff; High = Low+Diff; Mid=(High+Low) / 2; datalines; 1979 16.5 16.855 1980 16.6 16.139 1981 18.5 12.589 1982 16.0 13.395 1983 15.8 15.077 1984 16.2 14.480 1985 16.4 14.475 1986 15.2 15.935 1987 16.7 15.176 1988 16.5 14.853 1989 15.6 14.649 1990 16.5 13.679 1991 17.0 13.476 1992 15.0 14.864 1993 18.3 12.234 1994 16.5 13.611 1995 17.4 11.185 1996 15.0 13.715 1997 16.5 13.178 1998 18.0 11.512 1999 17.6 10.916 2000 15.9 10.954 2001 15.5 12.179 2002 16.6 10.792 2003 17.0 10.240 2004 16.0 9.881 2005 17.0 9.159 2006 16.3 8.993 2007 17.5 6.458 2008 18.1 7.072 2009 18.3 6.893 2010 18.8 4.428 2011 18.1 4.017 2012 18.5 3.261 ; run; ods html; proc print noobs;run; ods html close; ods listing gpath=&gpath image_dpi=&dpi style=htmlblue; /*--Macro by Perry Watts--*/ %macro RGBHex(rr,gg,bb); %sysfunc(compress(CX%sysfunc(putn(&rr,hex2.)) %sysfunc(putn(&gg,hex2.)) %sysfunc(putn(&bb,hex2.)))) %mend RGBHex; /*--Ice Graph SAS 9.3--*/ ods escapechar '~'; ods graphics / reset width=6in height=4.5in imagename='Ice_93'; proc sgplot data=ice noautolegend; format diff 4.1; title 'Arctic Sea Ice Volume'; title2 h=0.8 'Annual Maximum and Loss, and Ice Remaining at Minimum'; footnote j=l h=0.8 c=gray 'Source: PIOMAS.vol.daily.1979.2013.Current.v2.dat.gz (Version 2.0)'; highlow x=year low=low high=high / type=bar fillattrs=(color=silver) transparency=0.5 name='a' legendlabel='Ice remaining at yearly minimum'; series x=year y=high / lineattrs=(color=%rgbhex(0, 112, 192) thickness=3) name='b' legendlabel='Yearly ice maximum'; series x=year y=low / lineattrs=(color=red thickness=3) name='c' legendlabel='Yearly ice loss'; reg x=year y=high / degree=2 lineattrs=(color=%rgbhex(0, 112, 192) thickness=1) nomarkers; reg x=year y=low / degree=2 lineattrs=(color=red thickness=1) nomarkers; scatter x=year y=mid / markerchar=diff; xaxis display=(nolabel) values=(1979 to 2012 by 1) valueattrs=(size=7); yaxis label="Ice Volume [1000 Km ~{unicode '00b3'x} ]" values=(15 to 35 by 3) min=15 max=34 valueshint grid; keylegend 'a' 'b' 'c' / location=inside position=topright across=1 valueattrs=(size=7); run; /*--Ice Graph SAS 9.4M1 - with noborder, rotated labels, skins, smooth connect--*/ ods escapechar '~'; ods graphics / reset width=6in height=4.5in imagename='Ice_94'; proc sgplot data=ice noautolegend noborder; format diff 6.3; title 'Arctic Sea Ice Volume'; title2 h=0.8 'Annual Maximum and Loss, and Ice Remaining at Minimum'; footnote j=l h=0.8 c=gray 'Source: PIOMAS.vol.daily.1979.2013.Current.v2.dat.gz (Version 2.0)'; highlow x=year low=low high=high / type=bar dataskin=sheen fillattrs=(color=silver) transparency=0.5 name='a' legendlabel='Ice remaining at yearly minimum'; series x=year y=high / smoothconnect lineattrs=(color=%rgbhex(0, 112, 192) thickness=3) name='b' legendlabel='Yearly ice maximum'; series x=year y=low / smoothconnect lineattrs=(color=red thickness=3) name='c' legendlabel='Yearly ice loss'; reg x=year y=high / degree=2 lineattrs=(color=%rgbhex(0, 112, 192) thickness=1) nomarkers; reg x=year y=low / degree=2 lineattrs=(color=red thickness=1) nomarkers; polygon id=year x=year y=mid / label=diff rotate=90 labelattrs=(size=7); xaxis display=(nolabel) values=(1979 to 2012 by 1) valueattrs=(size=7) fitpolicy=none; yaxis label="Ice Volume [1000 Km ~{unicode '00b3'x} ]" values=(15 to 35 by 3) min=15 max=34 valueshint grid; keylegend 'a' 'b' 'c' / location=inside position=topright across=1 valueattrs=(size=7); run;