%let name=carbon; filename odsout '.'; /* This is a sas imitation/enhancement of the chart found at: http://www.physlink.com/Education/AskExperts/ae403.cfm Mammoth image from: http://www.crystalinks.com/woollymammoth.html */ data mydata; format pctcarbon percent6.0; format years comma6.0; pctcarbon=1; years=0; output; pctcarbon=pctcarbon/2; years=years+5730; output; pctcarbon=pctcarbon/2; years=years+5730; output; pctcarbon=pctcarbon/2; years=years+5730; output; pctcarbon=pctcarbon/2; years=years+5730; output; pctcarbon=pctcarbon/2; years=years+5730; output; run; data mydata; set mydata; length htmlvar $500; htmlvar='title='||quote( 'Percent Carbon 14: '|| trim(left(put(pctcarbon,percent8.2))) ||'0D'x|| 'Years Elapsed: '|| trim(left(put(years,comma6.0))) ) ||' '|| 'href="http://www.physlink.com/Education/AskExperts/ae403.cfm"'; run; data myanno; set mydata; length function color $ 15.; /* Write a label at each data point */ color='black'; text=' '||trim(left(put(pctcarbon,percent8.1))); position='c'; size=3.5; function='label'; xsys='2'; ysys='2'; hsys='3'; style='"arial"';x=years; y=pctcarbon; output; position='5'; size=.1; color='grayde'; /* draw a line from the data to the y-axis */ function='move'; xsys='2'; ysys='2'; x=years; y=pctcarbon; output; function='draw'; xsys='1'; x=0; output; /* draw a line from the data to the x-axis */ function='move'; xsys='2'; ysys='2'; x=years; y=pctcarbon; output; function='draw'; ysys='1'; y=0; output; run; /* Annotate a picture of the turtle onto the left-hand side of the map ... */ data img; length function text $ 8; length color $ 8; xsys='1'; ysys='1'; hsys='3'; when='A'; html='title="Woolly Mammoth Info" href="http://www.crystalinks.com/woollymammoth.html" '; function='move'; x=40; y=38; output; function='image'; x=x+60; y=y+60; imgpath='woolly.gif'; style='fit'; output; run; GOPTIONS DEVICE=png; ODS LISTING CLOSE; ODS HTML path=odsout body="&name..htm" (title="Radiocarbon C14 Decay Chart") style=minimal; goptions border; goptions gunit=pct htitle=6 htext=3 ftitle="arial/bo" ftext="arial" ; axis1 label=(angle=90 font="arial/bo" height=4pct 'Percent Carbon 14 Remaining') order=(0 to 1 by .25) minor=none offset=(0,0) /* value=(t=4 ' ') */ /* blank out the tickmark value label at 75% */ value=none major=none ; axis2 label=(font="arial/bo" height=4pct 'Years Elapsed') order=(0 to 28650 by 5730) minor=none offset=(0,0); title link="http://www.physlink.com/Education/AskExperts/ae403.cfm" "Rate of Decay for Carbon 14"; title2 " "; title3 a=-90 h=3pct " "; * title2 "(carbon dating half-life curve)"; symbol1 interpol=spline value=dot h=1.75 color=black; proc gplot data=mydata anno=img; plot pctcarbon*years=1 / anno=myanno vaxis=axis1 haxis=axis2 noframe html=htmlvar des="" name="&name" ; run; quit; ODS HTML CLOSE; ODS LISTING;