
A quick change-all-stars-to-hearts fork of the earlier Fun w/SAS ODS Graphics Twinkle-Twinkle-Little-Star Holiday Wreath. Happy Mother's Day, all!
* Fun w/SAS ODS Graphics: Happy Mother's Day Wreath of Hearts (Scatter + Text Plots)
A fork of earlier Fun w/SAS ODS Graphics Twinkle-Twinkle-Little-Star Holiday Wreath;
data wreath; /* Generate points for "wreath" graph */
do frame=1 to 25; /* Randomly change colors of hearts for each frame of GIF to make them twinkle */
tx=0; ty=0; msg="HAPPY*MOTHER'S*DAY!"; output; tx=.; ty=.; /* Happy Mother's Day! message in center of wreath */
do theta=0 to 2*constant("pi")+.1 by (2*constant("pi"))/60; /* Generate 60 points around a circle for hearts on wreath */
do r=1 to .7 by -.075; /* Five con-centric circles of hearts */
x=r*cos(theta); /* A little trigonometry to get x-coordinate */
y=r*sin(theta); /* And y-coordinate */
color=(rand("Integer", 0, 11)); /* Assign a random color for a 12-pastel color ramp */
output;
end;
end;
end;
ods graphics / imagefmt=GIF width=5in height=5in noborder; /* Record wreath images */
options nobyline papersize=('5 in', '5 in') animduration=.2 animloop=yes animoverlay printerpath=gif animation=start nodate nonumber;
ods printer file='~/momwreath/wreath.gif'; /* Animated GIF filename */
proc sgplot noautolegend aspect=1 noborder nowall pad=0; /* Generate a wreath! */
by frame; /* One image per frame to make hearts twinkle */
styleattrs backcolor=bipb; /* Brilliant purple background color */
symbolchar name=uniHeart char='2764'x; /* Unicode value for heart */
scatter x=x y=y / markerattrs=(symbol=uniHeart size=19pt) colormodel=(cXdda0dd cX87ceeb cX40e0D0 cXfff700 cX00ff7f cXbdfcc9 cXffc0cb cXffa07a cXee82ee cXc8a2c8 cX00cccc cXb573dc) colorresponse=color; * Generate pastel-colored hearts;
text x=tx y=ty text=msg / contributeoffsets=none textattrs=(size=30pt weight=bold color=white) splitchar='*' splitpolicy=splitalways contributeoffsets=none; * "Happy Mother's Day!" message;
xaxis display=none; yaxis display=none; /* Hide axes */
run;
options printerpath=gif animation=stop; /* Stop recording images */
ods printer close;