BookmarkSubscribeRSS Feed
tc
Lapis Lazuli | Level 10 tc
Lapis Lazuli | Level 10

SAS ODS Graphics Construction Paper Thanksgiving TurkeySAS ODS Graphics Construction Paper Thanksgiving Turkey

 

A quick SAS ODS Graphics take on kids' construction paper Thanksgiving turkey projects. Happy holidays!

 

* Fun w/SAS ODS Graphics: Construction Paper Thanksgiving Turkey
  Compare to craft project photo at etsy.com/listing/816756558/paper-craft-thanksgiving-turkey;
  
data turkey;      * Need points for 10 ellipses that make up turkey's "feathers";
r=1;
retain px py 0;   * Origin;
do aDeg=-30 to 210 by 24;            * aDeg is angle in degrees; 
  aRad=2*constant("pi")*r*aDeg/360;  * aRad is angle in radians;
  x=r*cos(aRad);                     * Compute x,y coordinates;
  y=r*sin(aRad);              
  c+1;                               * Assign 1 of 4 colors (cycle thru them);
  color=mod(c-1,4); 
  slope=y/x;                         * Compute slope of "feathers" (ellipses);
  output;
end;
                  * Use SAS ODS Graphics GTL to draw "construction paper" turkey (Ellipses + Oval/Polygon/Text annotations);
ods listing image_dpi=300 gpath='/folders/myfolders';
ods graphics on / reset antialias width=8in height=8in imagename="Turkey2020";

proc template;
define statgraph turkey;
begingraph / datacolors=(sienna red orange yellow sienna red orange yellow sienna red); * Thanksgiving-themed colors;
layout overlayequated / xaxisopts=(display=none thresholdmin=0 thresholdmax=0) yaxisopts=(display=none);
entry textattrs=(size=24pt weight=bold color=black) "HAPPY THANKSGIVING!"/ valign=top;
scatterplot x=px y=py; * "Dummy" plot - single point (x=0, y=0), needed for ellipseparms);
* "Feathers" (thanksgiving-themed color ellipses);
ellipseparm semiminor=.35 semimajor=.75 xorigin=x yorigin=y slope=slope / display=(fill) group=color; 
* "Body" (brpwn ellipse);
ellipseparm semiminor=.7 semimajor=.7 xorigin=0 yorigin=0 slope=0 / display=(fill) fillattrs=(color=brown);  
* "Head" (brpwn ellipse);
ellipseparm semiminor=.4 semimajor=.4 xorigin=0 yorigin=.75 slope=0 / display=(fill) fillattrs=(color=brown);
* "Pupils" (black ovals);
drawoval x=-.1 y=.925 / drawspace=datavalue HEIGHT=1.75 WIDTH=1.75 display=(fill) fillattrs=(color=black);
drawoval x=.1 y=.925 / drawspace=datavalue HEIGHT=1.75 WIDTH=1.75 display=(fill) fillattrs=(color=black);
* "Snood" (red tilde character, rotated 90 degrees);
drawtext textattrs=(size=82pt color=red weight=bold) "~" / drawspace=datavalue rotate=90 x=-.075 y=.84 anchor=right; 
* "Beak" (yellow triangle);
beginpolygon x=-.1 y=.825 / drawspace=datavalue display=(fill) fillAttrs=(color=yellow); draw x=.1 y=.825; draw x=0 y=.65; endpolygon;
entry textattrs=(size=24pt weight=bold color=black) "2020"/ valign=bottom;
endlayout;
endgraph;
end;
run;

proc sgrender data=turkey template=turkey; * Generate chart!;
run;

SAS ODS Graphics Turkey Without Fill ColorsSAS ODS Graphics Turkey Without Fill ColorsA Real Construction Paper Thanksgiving TurkeyA Real Construction Paper Thanksgiving Turkey

1 REPLY 1
Rick_SAS
SAS Super FREQ
This is great! Love the pic. DId you use SAS to get those perfectly formed ellipses for the physical turkey?

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 1000 views
  • 3 likes
  • 2 in conversation