Data visualization with SAS programming

Fun With SAS ODS Graphics: MOM Tattoo

Reply
Contributor tc
Contributor
Posts: 68

Fun With SAS ODS Graphics: MOM Tattoo

[ Edited ]

SasMomTatto.png

 

Happy Mother's Day! Thanks to Pavel Panchekha's How to Draw a Heart in Polar Coordinates for the formula, Rick Wicklin's Lo, how a polar rose e'er blooming for SAS code, and COLOURlovers for the Comic Skin Tone color code!

 

SAS CODE

* Fun With SAS ODS Graphics: Mom Tattoo;

data Heart;                                                     * Generate Data;
do t = 0 to 2*constant("pi") by 0.01;                           * Heart;
  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=.;
xMarker=-1.85; yMarker=-3.6; output; xmarker=.; ymarker=.;      * Arrow;
xArrowO=-1.85; yArrowO=-3.6; xArrow=2.5; yArrow=.75; output; xArrowO=.; yArrowO=.; xArrow=.; yArrow=.;
xArrowO2=1.25; yArrowO2=-.5; xArrow2=2.5; yArrow2=.75; output; xArrowO2=.; yArrowO2=.; xArrow2=.; yArrow2=.;
xText=0; yText=-1.25; Text='MOM'; output;                       * Text;

proc sgplot data=Heart aspect=1 nowall noautolegend noborder;   * Generate "Mom" tattoo;
styleattrs backcolor=cxF7CEB5;                                  * Change to match your own skin color!;
vector x=xArrow y=yArrow / 
       xorigin=xArrowO yorigin=yArrowO lineattrs=(color=darkgreen thickness=10pt) arrowheadshape=barbed;
scatter x=xMarker y=yMarker / markerattrs=(symbol=circlefilled size=20pt color=darkgreen);
series x=x y=y / lineattrs=(color=black thickness=5pt);
polygon x=x y=y id=id / fill fillattrs=(color=red);
vector x=xArrow2 y=yArrow2 / 
       xorigin=xArrowO2 yorigin=yArrowO2 lineattrs=(color=darkgreen thickness=10pt) arrowheadshape=barbed;
text x=xText y=yText text=Text / backlight=1 strip textattrs=(color=black size=72pt weight=bold);
xaxis display=none min=-2.4 max=2.5 offsetmax=.001 offsetmin=.001; 
yaxis display=none min=-4.2 max=1.3 offsetmax=.001 offsetmin=.001;

 

SAS Super FREQ
Posts: 1,044

Re: Fun With SAS ODS Graphics: MOM Tattoo

Nice use of backlight!  Smiley Happy

Post a Question
Discussion Stats
  • 1 reply
  • 366 views
  • 5 likes
  • 2 in conversation