Fun With SAS ODS Graphics: MOM Tattoo

Frequent Contributor
Posts: 80

Fun With SAS ODS Graphics: MOM Tattoo

[ Edited ]

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 /
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 /
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,184

Re: Fun With SAS ODS Graphics: MOM Tattoo

Nice use of backlight!

PROC Star
Posts: 1,800

Re: Fun With SAS ODS Graphics: MOM Tattoo

[ Edited ]

Hi @tc, if you are looking for ideas, it liked this challenge to proc gtile taken from

https://www.weforum.org/agenda/2017/03/worlds-biggest-economies-in-2017/

The "rest of the world" legend entry is badly named. This would leave only Antartica.

"Small countries" or "Countries with less than 0.39%" or "160 smallest countries" or similar would be more accurate.

Discussion stats
• 2 replies
• 611 views
• 6 likes
• 3 in conversation