<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Fun With SAS ODS Graphics: Easter Egg Dyeing in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Fun-With-SAS-ODS-Graphics-Easter-Egg-Dyeing/m-p/808232#M318686</link>
    <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HappyEaster2022.gif" style="width: 480px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/70510i0949B3625781FDE2/image-size/large?v=v2&amp;amp;px=999" role="button" title="HappyEaster2022.gif" alt="HappyEaster2022.gif" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A SAS ODS Graphics (polygon+spline+text plots) Happy Easter to all!&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;* Fun With SAS ODS Graphics: Easter Egg Dyeing;

data points;                                                         * Create points for "egg" made from an ellipse and a circle;
poly=1;                                                              * One polygon of points;
do x=-.75, -.75 to .75 by .01, .75;                                  * Top is a vertical half-ellipse (width=.75, height=1);
  y=sqrt(1-x**2/.75**2);
  if y^=. then output;                                               * Polygons don't like missing values, kids!;
end;
do x=.75, .75 to -.75 by -.01, -.75;                                 * Bottom is a semi-circle (r=.75, generate points right to left for polygon);
  y=-sqrt(.75**2-x**2);
  if y^=. then output;                                               * Polygons don't like missing values, kids!;
end;
x=.; y=.; xT=0; yT=.25/2; text="Happy*Easter!"; output;              * Centered Happy Easter! message;

%macro colorEggs;
%do transparency=0 %to 100 %by 2;                                    * Generate frames with varying levels of transparency;
%if &amp;amp;transparency=0 | &amp;amp;transparency=100 %then options animduration=1; %else options animduration=.12;; * Display first/last frame for 1 second, others for .12 second;
proc sgplot data=points aspect=1 noborder noautolegend nowall;       * Generate Easter Egg - polygon plot of half-ellipse + semi-circle points, spline plot border, text plot message;
polygon x=x y=y id=poly / nooutline fill nooutline fillattrs=(color=purple
        transparency=%sysevalf((100-&amp;amp;transparency)/100));            * "Egg" polygon;           
spline x=x y=y / lineattrs=(color=purple thickness=2pt);             * Draw smoother egg outline using spline plot;
text x=xT y=yT text=text / position=center vcenter=bbox splitchar='*' contributeoffsets=none
                           splitpolicy=splitalways textattrs=(size=48pt weight=bold color=white) strip; * Happy Easter! message;
xaxis display=none min=-.925 max=.925 offsetmax=.001 offsetmin=.001; * Limit x/y axis bounds;
yaxis display=none min=-.80 max=1.05 offsetmax=.001 offsetmin=.001;
run;
%end;
%mend;
                                                                     * Create animated GIF from frames;
options papersize=('5 in', '5 in') printerpath=gif animation=start 
        nodate nonumber animloop=YES animduration=1 NOANIMOVERLAY; 
ods printer file='~/HappyEaster2022.gif';              
ods graphics / reset antialias border=no height=5in width=5in imagefmt=gif border=off;

%colorEggs;                                                         * Generate Easter Egg animated GIF;

options printerpath=gif animation=stop;                             * Wrap-up animated GIF creation;                         
run;
ods printer close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 17 Apr 2022 14:48:07 GMT</pubDate>
    <dc:creator>tc</dc:creator>
    <dc:date>2022-04-17T14:48:07Z</dc:date>
    <item>
      <title>Fun With SAS ODS Graphics: Easter Egg Dyeing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Fun-With-SAS-ODS-Graphics-Easter-Egg-Dyeing/m-p/808232#M318686</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="HappyEaster2022.gif" style="width: 480px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/70510i0949B3625781FDE2/image-size/large?v=v2&amp;amp;px=999" role="button" title="HappyEaster2022.gif" alt="HappyEaster2022.gif" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A SAS ODS Graphics (polygon+spline+text plots) Happy Easter to all!&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;* Fun With SAS ODS Graphics: Easter Egg Dyeing;

data points;                                                         * Create points for "egg" made from an ellipse and a circle;
poly=1;                                                              * One polygon of points;
do x=-.75, -.75 to .75 by .01, .75;                                  * Top is a vertical half-ellipse (width=.75, height=1);
  y=sqrt(1-x**2/.75**2);
  if y^=. then output;                                               * Polygons don't like missing values, kids!;
end;
do x=.75, .75 to -.75 by -.01, -.75;                                 * Bottom is a semi-circle (r=.75, generate points right to left for polygon);
  y=-sqrt(.75**2-x**2);
  if y^=. then output;                                               * Polygons don't like missing values, kids!;
end;
x=.; y=.; xT=0; yT=.25/2; text="Happy*Easter!"; output;              * Centered Happy Easter! message;

%macro colorEggs;
%do transparency=0 %to 100 %by 2;                                    * Generate frames with varying levels of transparency;
%if &amp;amp;transparency=0 | &amp;amp;transparency=100 %then options animduration=1; %else options animduration=.12;; * Display first/last frame for 1 second, others for .12 second;
proc sgplot data=points aspect=1 noborder noautolegend nowall;       * Generate Easter Egg - polygon plot of half-ellipse + semi-circle points, spline plot border, text plot message;
polygon x=x y=y id=poly / nooutline fill nooutline fillattrs=(color=purple
        transparency=%sysevalf((100-&amp;amp;transparency)/100));            * "Egg" polygon;           
spline x=x y=y / lineattrs=(color=purple thickness=2pt);             * Draw smoother egg outline using spline plot;
text x=xT y=yT text=text / position=center vcenter=bbox splitchar='*' contributeoffsets=none
                           splitpolicy=splitalways textattrs=(size=48pt weight=bold color=white) strip; * Happy Easter! message;
xaxis display=none min=-.925 max=.925 offsetmax=.001 offsetmin=.001; * Limit x/y axis bounds;
yaxis display=none min=-.80 max=1.05 offsetmax=.001 offsetmin=.001;
run;
%end;
%mend;
                                                                     * Create animated GIF from frames;
options papersize=('5 in', '5 in') printerpath=gif animation=start 
        nodate nonumber animloop=YES animduration=1 NOANIMOVERLAY; 
ods printer file='~/HappyEaster2022.gif';              
ods graphics / reset antialias border=no height=5in width=5in imagefmt=gif border=off;

%colorEggs;                                                         * Generate Easter Egg animated GIF;

options printerpath=gif animation=stop;                             * Wrap-up animated GIF creation;                         
run;
ods printer close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Apr 2022 14:48:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Fun-With-SAS-ODS-Graphics-Easter-Egg-Dyeing/m-p/808232#M318686</guid>
      <dc:creator>tc</dc:creator>
      <dc:date>2022-04-17T14:48:07Z</dc:date>
    </item>
  </channel>
</rss>

