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

Heart-of-Hearts ValentineHeart-of-Hearts Valentine

 

Lifted some heart code from my "MOM tattoo", tweaked the red, filled it with valentine icons from The Noun Project, and voila - Happy Valentine's Day!

 

* Fun With SAS ODS Graphics: Heart-of-Hearts Valentine (Polygon+Scatter+Series Plots)
  Love icon courtesy of resty_agnesia, thenounproject.com/search/?q=valentine+heart&i=1535750;

data Heart;                                                     * Generate data for plots;
do t = 0 to 2*constant("pi") by 0.01;                           * X/Y=Points for red heart polygon;
  r=sin(t)*sqrt(abs(cos(t)))/(sin(t)+7/5)-2*sin(t)+2;
  x = r*cos(t);        
  y = r*sin(t);
  id=1;
  output;
end;
x=.; y=.; id=.;
do r=-3 to 3 by .5;                                             * X2/Y2=Points for white heart icon markers;
  do l=-5.15 to 3 by .5;
    x2=r; y2=l; output;                                         
    x2=r+.25; y2=l+.25; output;                                 * Offset heart icon markers from previous line;
  end;  
end;

ods graphics / reset antialias width=5in height=5in ;
proc sgplot data=Heart aspect=1 noborder noautolegend;          * Generate valentine (polygon+scatter+series plots);
title c=cxDC362D height=20pt "Happy Valentine's Day!";
symbolimage name=heart image='/folders/myfolders/WhiteValentineIcon.png'; 
polygon x=x y=y id=id / fill fillattrs=(color=cxDC362D);              * Red heart polygon plot; 
scatter x=x2 y=y2 / markerattrs=(color=white symbol=heart size=16pt); * White heart icon markers scatter plot;
series x=x y=y / lineattrs=(color=cxDC362D thickness=1pt);            * Red border series plot;
xaxis display=none min=-2.5 max=2.5 offsetmax=.001 offsetmin=.001; 
yaxis display=none min=-4 max=1 offsetmax=.001 offsetmin=.001;
run;

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 0 replies
  • 1045 views
  • 5 likes
  • 1 in conversation