<?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: O [Text &amp;amp; Scatter Plot] Xmas Tree in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-O-Text-amp-Scatter-Plot-Xmas-Tree/m-p/954764#M25208</link>
    <description>&lt;P&gt;Don't ignore rereading the RAND documentation...&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;letter=substr(a2z,rand('integer',1,26),1);&lt;/LI-CODE&gt;
&lt;P&gt;or ASCII&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;letter = byte(64+rand('integer',1,26))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 30 Dec 2024 12:17:18 GMT</pubDate>
    <dc:creator>RichardAD</dc:creator>
    <dc:date>2024-12-30T12:17:18Z</dc:date>
    <item>
      <title>Fun With SAS ODS Graphics: O [Text &amp; Scatter Plot] Xmas Tree</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-O-Text-amp-Scatter-Plot-Xmas-Tree/m-p/954451#M25199</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="otextscatterplotxmastree.png" style="width: 928px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103335iD9C4DD45B1C21EA5/image-size/large?v=v2&amp;amp;px=999" role="button" title="otextscatterplotxmastree.png" alt="otextscatterplotxmastree.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A SAS ODS Graphics text/scatter plot take on a couple of neat &lt;A href="https://en.wikipedia.org/wiki/Word_search" target="_self"&gt;word search&lt;/A&gt;-themed &lt;A href="https://www.dezeen.com/2022/12/23/christmas-cards-architects-designers-2022/" target="_self"&gt;architect and designer Xmas cards at dezeen&lt;/A&gt;. 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 - O [Text &amp;amp; Scatter Plot] Xmas Tree
  A take on a couple of holiday cards at dezeen.com/2022/12/23/christmas-cards-architects-designers-2022/;

data letters(keep=r c letter randnum);        * Generate random A-Z letters to fill a 13x13 grid;
retain a2z 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' letter ' ';
do r=1 to 13;
  do c=1 to 13;
    randnum=1+floor(rand("Uniform", 26));
    letter=substr(a2z,randnum,1);
    output;
  end;
end;  

data message(keep=x0 y0 xM yM textM);          * Generate x/y points and letters for a "Happy Holidays!" message; 
retain textM ' ';
msg=" HAPPYHOLIDAYS!";                         * Holiday message, x/y offset points for where to display letters (leave space at top for star!);
msgXY="0,0 -1,-2 1,-2 -2,-4 0,-4 2,-4 -3,-6 -1,-6 1,-6 3,-6 -4,-8 -2,-8 0,-8 2,-8 4,-8";
x0=7; y0=11;                                   * x/y origin of top of "Xmas tree";
do i=1 to length(msg);                         * Calc x/y locations of message letters;
  textM=substr(msg,i,1);                       * Message letter;
  xM=x0+scan(scan(msgXY,i,' '),1,', ');        * x location of message letter (origin+offset);
  yM=y0+scan(scan(msgXY,i,' '),2,', ');        * y location of message letter (origin+offset);
  output;
end;

proc sql;                                      * Insert our message into the grid, set color to white for message letters, black for others;
create table lettersmessage as 
select l.r, l.c, case when m.xM is null then 0 else 1 end as color, case when m.xM is not null then m.textM else l.letter end as letter, m.xM, m.yM, m.x0, m.y0
from letters l left join message m on l.r=m.yM and l.c=m.xM;
                                               * Display the tree!;
ods graphics / reset=all width=6.5in height=6.5in imagefmt=svg noborder;
proc sgplot data=lettersmessage noborder nowall noautolegend pad=0 aspect=1;
styleattrs backcolor=cx008975;                 * Nice shade of green from card (hex RGB code obtained using Paintbrush eyedropper);
text x=c y=r text=letter / colorresponse=color textattrs=(size=16pt weight=bold) colormodel=(black white); * Display black &amp;amp; white letters;
scatter x=x0 y=y0 / markerattrs=(size=11pt color=white symbol=starfilled); * Put a star on top;
scatter x=xM y=yM / markerattrs=(symbol=circle size=26pt color=white); * Draw white circles around message letters and star;
xaxis display=none values=(0 to 14); yaxis display=none values=(0 to 14); * Suppress axes and set width/height bounds;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 22 Dec 2024 18:49:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-O-Text-amp-Scatter-Plot-Xmas-Tree/m-p/954451#M25199</guid>
      <dc:creator>tc</dc:creator>
      <dc:date>2024-12-22T18:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: Fun With SAS ODS Graphics: O [Text &amp; Scatter Plot] Xmas Tree</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-O-Text-amp-Scatter-Plot-Xmas-Tree/m-p/954764#M25208</link>
      <description>&lt;P&gt;Don't ignore rereading the RAND documentation...&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;letter=substr(a2z,rand('integer',1,26),1);&lt;/LI-CODE&gt;
&lt;P&gt;or ASCII&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;letter = byte(64+rand('integer',1,26))&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Dec 2024 12:17:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-O-Text-amp-Scatter-Plot-Xmas-Tree/m-p/954764#M25208</guid>
      <dc:creator>RichardAD</dc:creator>
      <dc:date>2024-12-30T12:17:18Z</dc:date>
    </item>
  </channel>
</rss>

