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.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 2 replies
  • 968 views
  • 7 likes
  • 3 in conversation