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

HappyHalloween2022.png

 

Another holiday, another SAS ODS Graphics "craft project". Happy Halloween, all!

 

* Fun w/SAS ODS Graphics: Happy Halloween Ellipses Pumpkin
  Inspired by neat craft project at itsmejd.com/easy-diy-halloween-cards-make-minimal-supplies;
  
data pumpkin;          * Need one "dummy" point to use ellipseparm statements;
retain x y 0;  
                       * SAS ODS Graphics GTL Halloween greetings;
ods graphics on / reset antialias width=4in height=5.5in;
proc template;         * 5 ellipseparms + 2 drawrectangles + 1 drawtext (and 1 "dummy" scatterplot);
define statgraph pumpkin;
begingraph / backgroundcolor=black border=false pad=0in; 
layout overlay / xaxisopts=(display=none linearopts=(viewmin=-1 viewmax=1) offsetmin=0 offsetmax=0) 
                 yaxisopts=(display=none linearopts=(viewmin=-1 viewmax=1.1) offsetmin=.05 offsetmax=.15) 
                 walldisplay=none border=false outerpad=0in;
scatterplot x=x y=y;    * "Dummy" plot - single point (x=0, y=0), needed for ellipseparm); 
drawrectangle x=.05 y=1 width=.3 height=.6 / layer=back heightunit=data widthunit=data drawspace=datavalue rotate=-20 display=(fill) fillAttrs=(color=cx2EB62C); * Green "stem";
ellipseparm semiminor=.5 semimajor=1 xorigin=-1 yorigin=y slope=. / display=(fill outline) fillattrs=(color=cxFF7518) outlineattrs=(color=black); * Arranged to show desired outlines; 
ellipseparm semiminor=.5 semimajor=1 xorigin=-.5 yorigin=y slope=. / display=(fill outline) fillattrs=(color=cxFF7518) outlineattrs=(color=black); 
ellipseparm semiminor=.5 semimajor=1 xorigin=1 yorigin=y slope=. / display=(fill outline) fillattrs=(color=cxFF7518) outlineattrs=(color=black); 
ellipseparm semiminor=.5 semimajor=1 xorigin=.5 yorigin=y slope=. / display=(fill outline) fillattrs=(color=cxFF7518) outlineattrs=(color=black); 
ellipseparm semiminor=.5 semimajor=1 xorigin=0 yorigin=y slope=. / display=(fill outline) fillattrs=(color=cxFF7518) outlineattrs=(color=black); 
drawrectangle x=0 y=-.15 width=2 height=.5 / anchor=top layer=front heightunit=data widthunit=data drawspace=datavalue display=(fill) fillAttrs=(color=black); 
drawtext textattrs=(size=20pt weight=bold color=white) "HAPPY HALLOWEEN!" /
         layer=front anchor=center justify=center width=100 widthunit=percent xspace=datavalue yspace=datavalue x=0 y=-.4;
endlayout;
endgraph;
end;

proc sgrender data=pumpkin(obs=1) template=pumpkin; * Generate chart!;
run;

BEFORE COLORING

HappyHalloween2022Wireframe.png

 

 

 

 

 

JUST RELEASED

SAS Viya with pay-as-you-go pricing.

Deploy software automatically at the click of a button on the Microsoft Azure Marketplace.

Learn more

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.

Recommended by SAS
These recommendations are generated using AI from SAS. For personalized recommendations, sign in with your SAS profile.
Discussion stats
  • 0 replies
  • 96 views
  • 1 like
  • 1 in conversation