Based on a Free Kids Crafts Thanksgiving project, here's a quick SAS ODS Graphics take on a Pilgrim hat. Happy Thanksgiving, all!
* Fun With SAS ODS Graphics: Happy Thanksgiving, Pilgrim! (5-Polygon Pilgrim Hat)
Based on children's craft project at freekidscrafts.com/tissue-paper-pilgrim-hat;
data PilgrimHat; /* Generate pairs of x,y points for 5 polygons */
infile datalines dlm=', ';
input x y@@;
id=floor((_n_-1)/4)+1; /* 4 pairs of x,y points per polygon */
datalines;
0,0 540,0 540,110 0,110
40,110 500,110 490,205 50,205
53,205 487,205 460,530, 80,530
190,100 350,100 350,215 190,215
230,135 310,135 310,180 230,180
; /* Plot pilgrim hat polygons */
ods graphics / reset antialias border=off width=5.43in height=5.35in;
proc sgplot aspect=1 pad=10 nowall noborder noautolegend;
styleattrs backcolor=cxF9F1D9 datacolors=(black brown black orange brown);
polygon x=x y=y id=id / group=id nooutline fill;
inset "HAPPY THANKSGIVING!" / position=bottom textattrs=(weight=bold size=28pt color=cxB95328);
xaxis display=none offsetmin=.1 offsetmax=.1 values=(0 543);
yaxis display=none offsetmin=.12 offsetmax=.03 values=(0 535);
run;
Just for fun. 🙂
data have;
infile CARDS missover;
input x l u g :$1. lab $50.;
cards;
5 0 20 A
10 0 20 A
12 0 80 A
38 0 80 A
40 0 20 A
45 0 20 A
10 20 35 B
40 20 35 B
20 15 40 C
30 15 40 C
22 20 35 D
28 20 35 D
;
run;
proc sgplot data=have aspect=1 nowall noborder noautolegend ;
styleattrs backcolor=cxF9F1D9 datacolors=(black brown orange brown);
BAND x=x lower=l upper=u / group=g;
xaxis display=(NOTICKS NOVALUES NOLINE)
label="HAPPY THANKSGIVING!"
labelattrs=(size=6pct color=brown weight=bold)
;
yaxis display=none;
run;
Bart
Thank you! 🙂
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.