행복한 발렌타인데이 되시기를..
* SAS 프로그램 소스 : http://www.robslink.com/SAS/democd76/valentines_graph.sas
* 출처
http://blogs.sas.com/content/sastraining/2015/02/12/have-a-traditional-sasgraph-valentines-day/
%let name=valentines_graph;
filename odsout '.'; %let pink=cxFF3333; %let darkgray=gray66; data heart_data; do x=-2 to 2 by .05; y=sqrt(1-(abs(x)-1)**2); output; end; do x=2 to -2 by -.05; y=arcos(1-abs(x))-3.14; output; end; run; data heart_data; set heart_data; /* set the undefined values to zero */ if y=. then y=0; /* re-shape the deep parts of the 'V' just a tiny bit */ if round(x*100)=0 then y=y+.2; /* an id variable for gmap */ idvar='heart'; my_html= 'title='||quote('I Love SAS!')|| ' href='||quote('http://blogs.sas.com/content/searchresults/?mssearch=valentine');; run; data anno_arrow; length function $8; xsys='2'; ysys='2'; hsys='3'; when='a'; color="&darkgray"; function='move'; x=-2; y=-2.5; output; function='draw'; x=-.75; y=-1.25; output; function='move'; x=1; y=.5; output; function='arrow'; x=1.75; y=1.25; line=4; output; run; goptions device=png; goptions noborder; ODS LISTING CLOSE; ODS HTML path=odsout body="&name..htm" (title="Valentine's Heart SAS Graph") style=htmlblue; goptions gunit=pct ftitle='albany amt/bold' ftext='albany amt' htitle=4.8 htext=2.5 ctext=&darkgray; symbol1 value=dot h=1.0 interpol=none c=&pink; axis1 order=(-3.5 to 1.5 by .5) minor=none value=(c=grayaa) offset=(0,0); axis2 order=(-4.5 to 4.5 by .5) minor=none value=(c=grayaa) offset=(0,0); title1 ls=1.5 "Traditional SAS/Graph " c=&pink "Proc GPlot" c=&darkgray " Heart"; proc gplot data=heart_data anno=anno_arrow; plot y*x / vaxis=axis1 haxis=axis2 autohref autovref noframe des='' name="&name"; run; title1 ls=1.5 "Traditional SAS/Graph " c=&pink "Proc GMap" c=&darkgray " Heart"; title2 h=8 ' '; pattern1 v=s c=&pink; proc gmap data=heart_data map=heart_data anno=anno_arrow; id idvar; choro idvar / nolegend coutline=&darkgray html=my_html des='' name="&name"; run; quit; ODS HTML CLOSE;
ODS LISTING;
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Early bird rate extended! Save $200 when you sign up by March 31.