Lapis Lazuli | Level 10

## Fun With SAS ODS Graphics: M-O-M Bracelet

Happy Mother's Day, all!

``````* Fun w/SAS ODS Graphics: Mom Bracelet;

data beads;                      * Create "beads" for Mom bracelet;
retain size 1;                   * All beads same size;
pi=constant("pi");               * 3.414...;
do i=1 to 20;                    * Plot 20 points around circle (see blogs.sas.com/content/graphicallyspeaking/2018/11/01/text-plot-can-do-that/);
angle=90-i*18;
x=cos(angle*pi/180);
y=sin(angle*pi/180);
angle=angle+90;                * Add 90 to angle to rotate letter labels at bottom back upright;
if i in (9, 11) then txt="M";  * Add letters 'M' in beads 9 and 11 for 'MOM' (counting from top and going clockwise);
if i=10 then yH=y;             * Need a point to plot a heart in bead 10 (instead of the 'O' in 'MOM');
output;
yh=.; txt="";                  * Reset variables;
end;
* Let's plot the bracelet! (Ellipse + Bubble + Text Plots);
ods graphics / width=5.5in height=5.5in antialias noborder;
proc sgplot data=beads noautolegend noborder pad=0 aspect=1 nowall subpixel noborder pad=0;
styleattrs backcolor=cxfff9ff;   * Very light pink background;
symbolimage name=heart image='/home/ted.conway/heart.png'; * Use white heart image for the 'O' in 'MOM';
ellipseparm semimajor=1 semiminor=1 / slope=0 xorigin=0 yorigin=0 outline lineattrs=(color=vipk thickness=3pt); * 'Elastic' to string beads;