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

squarecirclesvalentine.png

 

Tired: Say It With Flowers. Wired: Say It With Geometry. 😀 Happy Valentine's Day!

 

* Fun With SAS ODS Graphics: Square + Circles Valentine;

data points;                                       * Generate points for square (polygon) and 2 circles (ellipses);                                          
retain polygon 1;
xs=-cos(constant("pi")/4); ys=0; output;           * 1 square, sides of length 1, rotated 45 degrees; 
xs=0; ys=sin(constant("pi")/4); output; 
xs=cos(constant("pi")/4); ys=0; output;     
xs=0; ys=-sin(constant("pi")/4); output; 
xs=.; group=1;                                     * 2 circles, diameter 1, centered on top left/right sides of square;  
x=-cos(constant("pi")/4)/2; y=sin(constant("pi")/4)/2; output; x=-x; output; 

ods graphics / width=5in height=5in;
proc sgplot aspect=1 noautolegend nowall noborder; * Draw valentine (1 square + 2 circles);
styleattrs backcolor=lightpink;
inset "HAPPY VALENTINE'S DAY!" / position=bottom textattrs=(color=cxC00000 weight=bold size=18pt);
polygon x=xs y=ys id=polygon / fill fillattrs=(color=cxC00000) transparency=.0 outline 
             lineattrs=(color=cxC00000 thickness=3pt) transparency=.5;
ellipseparm semimajor=.5 semiminor=.5 / xorigin=x yorigin=y group=group nomissinggroup 
            outline lineattrs=(color=cxC00000 thickness=3pt) xorigin=x yorigin=y  
            fill fillattrs=(color=cxC00000) transparency=.5;
xaxis display=none values=(-.9 .9);
yaxis display=none values=(-.9 .9);
run;
1 REPLY 1
Jay54
Meteorite | Level 14
Very nice, TC. Happy to learn the heart shape could be built using three simple primitives.

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 1 reply
  • 500 views
  • 6 likes
  • 2 in conversation