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

PumpkinPiePlot.png

 

It wouldn't be Thanksgiving without a SAS ODS Graphics pumpkin pie, right? Happy Thanksgiving, all! 

 

* Fun w/SAS ODS Graphics: Happy Thanksgiving Pumpkin Pie Plot (Ellipse + Spline + Text Plots);
  
data pumpkinpie;                           * Generate points for graph;
retain tx ty 0 msg "HAPPY*THANKSGIVING!"; 
output; tx=.; tx=.;                        * Display "Happy Thanksgiving!" text greeting at origin (0,0); 
do theta=0 to 2*constant("pi")+.1 by .01;  * Generate points around a circle for rippled "pie crust";  
  r=1+0.04*sin(28*theta);                  * Use sine function to vary radius for ripple effect; 
  x=r*cos(theta);                          * A little trigonometry to get x-coordinate;                           
  y=r*sin(theta);                          * And y-coordinate;
  output;
end;  

proc sgplot noautolegend aspect=1;         * Let's "bake" a pumpkin pie!;
ellipseparm semimajor=1 semiminor=1 / slope=0 xorigin=0 yorigin=0 fill fillattrs=(color=cxC3540C); * PUmpkin pie "filling";
spline x=x y=y / lineattrs=(thickness=12pt color=cxf2d89f); * Pie "crust";
text x=tx y=ty text=msg / backlight=1 contributeoffsets=none textattrs=(size=22pt weight=bold color=white) splitchar='*' splitpolicy=splitalways contributeoffsets=none; * "Happy Thanksgiving!" message;
run;

 

Before Coloring/StylingBefore Coloring/Styling

2 REPLIES 2
fja
Lapis Lazuli | Level 10 fja
Lapis Lazuli | Level 10
Nice coding ... makes me wonder if polar coordinates could be used directly.
WeiChen
Obsidian | Level 7

I like your holiday graphs! Thanks for posting.

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1415 views
  • 7 likes
  • 3 in conversation