Happy Thanksgiving!
Thanksgiving week is upon us, so here's a quick SAS ODS Graphics waffle chart (aka isotype chart, aka pictogram, aka scatter plot!) to display the factoid that 88% of Americans reportedly plan to feast on turkey this holiday season. For another SAS ODS Graphics take on waffle charts, check out Abhinav Srivastva's PhUSE US Connect 2021 paper, Waffle Chart in SAS. Happy Thanksgiving, all!
* Fun With SAS ODS Graphics: Thanksgiving Turkey Waffle Chart
Turkey factoid found at: finder.com/american-thanksgiving-turkey-spend;
data turkeys; * Generate 100 points for turkey images(100%);
do p=1 to 100;
x=floor((p-1)/10); * Fill columns from left to right, rows from bottom to top - (0,0) to (9,9);
y=mod(p-1,10); * Assign category - turkey (88%) or no turkey;
if p<=88 then Dinner='Turkey '; else Dinner='No Turkey';
output;
end;
data myattrmap; * Create attribute map to assign images to categories;
id="myid"; value='Turkey '; markersymbol='turkey '; output;
id="myid"; value='No Turkey'; markersymbol='noturkey'; output;
* Generate 'waffle' chart of turkey images (scatter plot of images);
proc sgplot data=turkeys noborder dattrmap=myattrmap nowall noautolegend pad=(top=4pt left=.25in right=.25in bottom=0pt);
styleattrs backcolor=cxFBFBD5; * Light goldenrod yellow background, 'seal brown' text & images;
inset ' 88% of Americans Plan on Turkey for Thanksgiving ' / textattrs=(size=15.5pt color=cx623004 weight=bold) position=top;
symbolimage name=turkey image='/home/ted.conway/turkey3.png'; * Filled turkey (Office365 turkey icon);
symbolimage name=noturkey image='/home/ted.conway/noturkey3.png'; * Turkey outline (Office365 turkey icon);
scatter x=x y=y / attrid=myid markerattrs=(size=32pt) group=dinner; * Scatter plot w/custom legend;
keylegend 'turkey' 'noturkey' / noborder noopaque position=bottom location=inside;
legenditem type=marker name='turkey' / markerattrs=(symbol=turkey size=22pt) label='Turkey' labelattrs=(size=12pt weight=bold color=cx623004);
legenditem type=marker name='noturkey' / markerattrs=(symbol=noturkey size=22pt) label='No Turkey' labelattrs=(size=12pt weight=bold color=cx623004);
xaxis display=none; yaxis display=none offsetmin=.13 offsetmax=.13; * Suppress axes, add padding;
TURKEYS (Office365 Turkey Icons)
TurkeyNo Turkey
BLACK & WHITE
Look Ma, No Color!