<?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 Re: Fun With SAS ODS Graphics - Damped  Oscillation Xmas Tree in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-Damped-Oscillation-Xmas-Tree/m-p/786718#M22449</link>
    <description>&lt;P&gt;Couldn't resist to make it "alive".&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="DampedOscillationXmasTree.gif" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66874iDCE677C9D9AE48A9/image-size/large?v=v2&amp;amp;px=999" role="button" title="DampedOscillationXmasTree.gif" alt="DampedOscillationXmasTree.gif" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro DampedOscillationXmasTree(i=1,n=25);

ods graphics / antialias height=6.25in width=5in;         
ods escapechar='^'; 

ods html;

ods graphics / imagefmt=GIF;
options
papersize=('6.25 in', '5 in') 
nodate nonumber
nonotes
animduration=0.12
animloop=yes 
noanimoverlay
printerpath=gif 
animation=start;

ods printer file="%sysfunc(pathname(work))\DampedOscillationXmasTree.gif";
ods html select none;

%do i= &amp;amp;i. %to &amp;amp;n.;
  data sinewave;                                           
  e = constant("e");                                       
  do y=-.9 to 45 by .1;                                   
    x=-2**(-0.1*y)*sin(y+&amp;amp;i.);                                 
    output;
  end;
                                        
  proc sgplot data=sinewave noborder nowall subpixel;           
  styleattrs backcolor=cxE40A2D;                            
  title height=32pt color=white bold 
  font="Arial Unicode MS" "^{unicode '2605'x}"; 
  series x=x y=y / lineattrs=(color=white thickness=5pt);   
  refline 0 / axis=x lineattrs=(color=white thickness=3pt); 
  xaxis display=none min=-1 max=1; 
  yaxis display=none;                   
  footnote  height=6pt " ";                                 
  footnote2 height=24pt color=white bold "Happy Holidays!"; 
  footnote3 height=1pt " ";                                 
  run;
%end;

ods html select all;
options
notes 
printerpath=gif 
animation=stop;
ods printer close;

%mend DampedOscillationXmasTree;

%DampedOscillationXmasTree()&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 20 Dec 2021 11:44:31 GMT</pubDate>
    <dc:creator>yabwon</dc:creator>
    <dc:date>2021-12-20T11:44:31Z</dc:date>
    <item>
      <title>Fun With SAS ODS Graphics - Damped  Oscillation Xmas Tree</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-Damped-Oscillation-Xmas-Tree/m-p/786690#M22448</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="xmastree.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66871i0173EE5CF33AEF29/image-size/medium?v=v2&amp;amp;px=400" role="button" title="xmastree.png" alt="xmastree.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;'Twas the week before Xmas, so here's&amp;nbsp;a holiday card fashioned from a&amp;nbsp;&lt;A href="https://en.wikipedia.org/wiki/Q_factor" target="_self"&gt;formula for an exponentially damped sine wave&lt;/A&gt;&amp;nbsp;using SAS ODS Graphics. Happy Holidays, all!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;* Fun With SAS ODS Graphics - Exponentially Damped Oscillation Xmas Tree
  Reference: https://en.wikipedia.org/wiki/Q_factor;

data sinewave;                                            * Generate sine wave points;
e = constant("e");                                        * Euler's number (2.71828...);
do x=-.9 to 35 by .05;                                    * Y goes to zero at about 35;
  y=e**(-0.1*x)*sin(x);                                   * Formula for damped oscillation curve (source: Wikipedia);
  output;
end;

proc sql;                                                 * Rotate/flip x-axis oriented sine wave to create y-axis Xmas tree; 
create table tree as select -y as x, x as y from sinewave;
                                                          * Plot the Xmas tree (series plot);
ods graphics / antialias height=6.25in width=5in;         * Size image;
ods escapechar='^';                                       * Define escape character for Unicode star above tree;
proc sgplot data=tree noborder nowall subpixel;           * Suppress chart border and wall;               
styleattrs backcolor=cxE40A2D;                            * Christmas red;
title height=32pt color=white bold font="Arial Unicode MS" "^{unicode '2605'x}"; * Unicode star title;
series x=x y=y / lineattrs=(color=white thickness=5pt);   * Sine curve tree;
refline 0 / axis=x lineattrs=(color=white thickness=3pt); * Reference line tree trunk;
xaxis display=none; yaxis display=none;                   * Suppress axes;
footnote  height=6pt " ";                                 * A little padding;                                 
footnote2 height=24pt color=white bold "Happy Holidays!"; * Holiday greeting footnote;
footnote3 height=1pt " ";                                 * A little more padding;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;STEP 1&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Sine Wave" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66872iFD4F1D1F72B27BC5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sinewave1.png" alt="Sine Wave" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Sine Wave&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;STEP 2&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Transformed Sine Wave" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66873i9DE396DFCA113039/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sinewave2.png" alt="Transformed Sine Wave" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;Transformed Sine Wave&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Dec 2021 05:05:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-Damped-Oscillation-Xmas-Tree/m-p/786690#M22448</guid>
      <dc:creator>tc</dc:creator>
      <dc:date>2021-12-20T05:05:48Z</dc:date>
    </item>
    <item>
      <title>Re: Fun With SAS ODS Graphics - Damped  Oscillation Xmas Tree</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-Damped-Oscillation-Xmas-Tree/m-p/786718#M22449</link>
      <description>&lt;P&gt;Couldn't resist to make it "alive".&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="DampedOscillationXmasTree.gif" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/66874iDCE677C9D9AE48A9/image-size/large?v=v2&amp;amp;px=999" role="button" title="DampedOscillationXmasTree.gif" alt="DampedOscillationXmasTree.gif" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%macro DampedOscillationXmasTree(i=1,n=25);

ods graphics / antialias height=6.25in width=5in;         
ods escapechar='^'; 

ods html;

ods graphics / imagefmt=GIF;
options
papersize=('6.25 in', '5 in') 
nodate nonumber
nonotes
animduration=0.12
animloop=yes 
noanimoverlay
printerpath=gif 
animation=start;

ods printer file="%sysfunc(pathname(work))\DampedOscillationXmasTree.gif";
ods html select none;

%do i= &amp;amp;i. %to &amp;amp;n.;
  data sinewave;                                           
  e = constant("e");                                       
  do y=-.9 to 45 by .1;                                   
    x=-2**(-0.1*y)*sin(y+&amp;amp;i.);                                 
    output;
  end;
                                        
  proc sgplot data=sinewave noborder nowall subpixel;           
  styleattrs backcolor=cxE40A2D;                            
  title height=32pt color=white bold 
  font="Arial Unicode MS" "^{unicode '2605'x}"; 
  series x=x y=y / lineattrs=(color=white thickness=5pt);   
  refline 0 / axis=x lineattrs=(color=white thickness=3pt); 
  xaxis display=none min=-1 max=1; 
  yaxis display=none;                   
  footnote  height=6pt " ";                                 
  footnote2 height=24pt color=white bold "Happy Holidays!"; 
  footnote3 height=1pt " ";                                 
  run;
%end;

ods html select all;
options
notes 
printerpath=gif 
animation=stop;
ods printer close;

%mend DampedOscillationXmasTree;

%DampedOscillationXmasTree()&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 20 Dec 2021 11:44:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-Damped-Oscillation-Xmas-Tree/m-p/786718#M22449</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2021-12-20T11:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: Fun With SAS ODS Graphics - Damped  Oscillation Xmas Tree</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-Damped-Oscillation-Xmas-Tree/m-p/786879#M22457</link>
      <description>LIKE!!</description>
      <pubDate>Tue, 21 Dec 2021 01:10:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-Damped-Oscillation-Xmas-Tree/m-p/786879#M22457</guid>
      <dc:creator>wwvierg</dc:creator>
      <dc:date>2021-12-21T01:10:58Z</dc:date>
    </item>
    <item>
      <title>Re: Fun With SAS ODS Graphics - Damped  Oscillation Xmas Tree</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-Damped-Oscillation-Xmas-Tree/m-p/786880#M22458</link>
      <description>&lt;P&gt;Sweet! Well played Bart.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 01:17:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-Damped-Oscillation-Xmas-Tree/m-p/786880#M22458</guid>
      <dc:creator>wwvierg</dc:creator>
      <dc:date>2021-12-21T01:17:40Z</dc:date>
    </item>
  </channel>
</rss>

