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

SAS ODS GraphicsSAS ODS Graphics Craft Project (Source: itsmejd.com)Craft Project (Source: itsmejd.com) 

 

With the Halloween weekend upon us, here's a SAS ODS Graphics Polygon + Bubble + Text + Lineparm + Ellipseparm plot take on a DIY Halloween Card craft project from the it's me,JD blog (parabola math refresher here). Happy Halloween, all!

 

 * Fun With SAS ODS Graphics: Para-boo!-la Halloween Card
   SAS ODS Graphics take on craft project at itsmejd.com/easy-diy-halloween-cards-make-minimal-supplies/;
  
data paraBOOla;                                                      * Generate x-y point coordinates, text for charts;
retain id 1;                                                         * Polygons require ID #;
/*Polygon*/ do x=-3.3 to 3.3 by .1; y=x**2/-4*2.5+1.95; output; end; * Parabola formula used to draw top of 'ghost';
            y=-6; output; x=-3.3; output;                            * Close off polygon with rectangular bottom of 'ghost';
/*Eyes   */ x=.; x2=-0.75; y=-.25; size=.35; output; x2=.75; output; * Eyes of 'ghost';
/*Text1  */ x2=.; x3=0; y=-3.5; txt='boo!              '; output;    * Add some text to card;  
/*Text2  */ x3=.; x4=2.9; y=-4.75; txt='HAPPY HALLOWEEN'; output;
/*Circles*/ x4=.; r=.6; do x5=-2.5 to 2.5 by 1; output; end;         * Circles (r=radius) used to draw bottom of 'ghost';

ods graphics / reset width=6in height=8in antialias ; 
proc sgplot data=paraBOOla nowall pad=0 noautolegend subpixel;       * Let's make a Halloween card!;
styleattrs backcolor=cxFE9A0A;                                       * 'Halloween orange';
polygon x=x y=y id=id / fillattrs=(color=white) fill lineattrs=(color=white); * Parabola 'ghost'; 
bubble x=x2 y=y size=size / fillattrs=(color=black) dataskin=matte bradiusmin=.5 bradiusmax=.5 absscale; * Eyes (bubbles w/radius=.5);
text x=x3 y=y text=txt / backlight=1 textattrs=(color=white weight=bold size=90pt) contributeoffsets=none; * Boo! with backlight effect;
text x=x4 y=y text=txt / textattrs=(color=black weight=bold size=21pt) position=left contributeoffsets=none; * Happy Halloween;
lineparm x=-3.1 y=-5 slope=0 / lineattrs=(color=black thickness=3pt) clip; * Line separator;                  
ellipseparm semimajor=r semiminor=r / xorigin=x5 yorigin=-6.2 clip fillattrs=(color=cxFE9A0A) fill; * Circles at bottom of 'ghost' (cheesy drape effect!);
xaxis display=none values=(-3 3) offsetmin=0 offsetmax=0 thresholdmin=0 thresholdmax=0; * Limit x range to 'crop' ghost at sides;
yaxis display=none values=(-6 2.2) offsetmax=0;                      * Limit y-range;
run;

Para-boo!-la: First DraftPara-boo!-la: First Draft

 

 

 

1 REPLY 1
whymath
Lapis Lazuli | Level 10
Very Impressive, JD!

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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
  • 1 reply
  • 1304 views
  • 13 likes
  • 2 in conversation