Heart-of-Hearts Valentine
Lifted some heart code from my "MOM tattoo", tweaked the red, filled it with valentine icons from The Noun Project, and voila - Happy Valentine's Day!
* Fun With SAS ODS Graphics: Heart-of-Hearts Valentine (Polygon+Scatter+Series Plots)
Love icon courtesy of resty_agnesia, thenounproject.com/search/?q=valentine+heart&i=1535750;
data Heart; * Generate data for plots;
do t = 0 to 2*constant("pi") by 0.01; * X/Y=Points for red heart polygon;
r=sin(t)*sqrt(abs(cos(t)))/(sin(t)+7/5)-2*sin(t)+2;
x = r*cos(t);
y = r*sin(t);
id=1;
output;
end;
x=.; y=.; id=.;
do r=-3 to 3 by .5; * X2/Y2=Points for white heart icon markers;
do l=-5.15 to 3 by .5;
x2=r; y2=l; output;
x2=r+.25; y2=l+.25; output; * Offset heart icon markers from previous line;
end;
end;
ods graphics / reset antialias width=5in height=5in ;
proc sgplot data=Heart aspect=1 noborder noautolegend; * Generate valentine (polygon+scatter+series plots);
title c=cxDC362D height=20pt "Happy Valentine's Day!";
symbolimage name=heart image='/folders/myfolders/WhiteValentineIcon.png';
polygon x=x y=y id=id / fill fillattrs=(color=cxDC362D); * Red heart polygon plot;
scatter x=x2 y=y2 / markerattrs=(color=white symbol=heart size=16pt); * White heart icon markers scatter plot;
series x=x y=y / lineattrs=(color=cxDC362D thickness=1pt); * Red border series plot;
xaxis display=none min=-2.5 max=2.5 offsetmax=.001 offsetmin=.001;
yaxis display=none min=-4 max=1 offsetmax=.001 offsetmin=.001;
run;