<?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: Matrix Plot in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-Matrix-Plot/m-p/942138#M24988</link>
    <description>&lt;P&gt;Nice. Good to see other ways of achieving the same outcome with PROC IML.&lt;/P&gt;</description>
    <pubDate>Mon, 02 Sep 2024 05:47:58 GMT</pubDate>
    <dc:creator>ClarkLawson</dc:creator>
    <dc:date>2024-09-02T05:47:58Z</dc:date>
    <item>
      <title>Fun With SAS ODS Graphics: Matrix Plot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-Matrix-Plot/m-p/942133#M24987</link>
      <description>&lt;P&gt;Under the spring of this article:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Stepping-into-the-Matrix-in-SAS/ta-p/940095" target="_blank" rel="noopener"&gt;https://communities.sas.com/t5/SAS-Communities-Library/Stepping-into-the-Matrix-in-SAS/ta-p/940095&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Since it is about Matrix Graphic, I think it is more efficient and suitable by using SAS/IML Matrix code .&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc iml;
want=j(400,20,' ');
alphabet =('A':'Z') || ('0':'9');

do ncol=1 to ncol(want);
n=1;
do i=1 to int(nrow(want)/20);  /*the number of repeated string in a column*/
  temp=j(1,sample((1:10),1),' ')||sample(alphabet,sample((1:10),1),'wor');  /*randomly generated string*/
  len=ncol(temp);
  want[n:n+len-1,ncol]=t(temp);
  n=n+len;
end;
end;

row=row(want);
col=col(want);
temp_page=.;  /* int(nrow(want)/10) is the size of a page */
temp_value=' ';
temp_row=.;
temp_col=.;
create final_want var {temp_page temp_value temp_row temp_col};
do page=1 to nrow(want)-int(nrow(want)/10);  
  temp_page=colvec(j(int(nrow(want)/10),ncol(want),page));  /*a page or graph has 40 rows*/
  temp_value=colvec(t(want[page:page+int(nrow(want)/10)-1,]));
  temp_row=colvec(t(row[page:page+int(nrow(want)/10)-1,]));
  temp_col=colvec(t(col[page:page+int(nrow(want)/10)-1,]));
append ;
end;
close;
quit;
data final_want;
 set final_want;
 by temp_page;
 if first.temp_page or missing(temp_value) then group=0;
 if not missing(temp_value) then group+1;
run;

ods _all_ close;  
options nobyline papersize=('5 in', '5 in') animduration=0.2 animloop=yes noanimoverlay printerpath=gif animation=start nodate nonumber;
ods printer file='c:\temp\matrix.gif';
ods graphics / width=5in height=5in antialias noborder imagefmt=GIF;
proc sgplot data=final_want aspect=1 noborder  noautolegend;
by temp_page;
styleattrs backcolor=black wallcolor=black
datacontrastcolors=(white  CXFFFFCC CXD9F0A3 CXADDD8E CX78C679 CX41AB5D CX238443 CX005A32 CXF0F0F0 CXBDBDBD CX636363 );
scatter y=temp_row x=temp_col/  markerchar=temp_value group=group labelstrip markercharattrs=(weight=bold);
xaxis display=none;
yaxis display=none;
run;
options printerpath=gif animation=stop;
ods printer close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="matrix.gif" style="width: 480px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/99946iEB3F46D5B9D38B8B/image-size/large?v=v2&amp;amp;px=999" role="button" title="matrix.gif" alt="matrix.gif" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Sep 2024 07:05:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-Matrix-Plot/m-p/942133#M24987</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-09-04T07:05:53Z</dc:date>
    </item>
    <item>
      <title>Re: Fun With SAS ODS Graphics: Matrix Plot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-Matrix-Plot/m-p/942138#M24988</link>
      <description>&lt;P&gt;Nice. Good to see other ways of achieving the same outcome with PROC IML.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Sep 2024 05:47:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-Matrix-Plot/m-p/942138#M24988</guid>
      <dc:creator>ClarkLawson</dc:creator>
      <dc:date>2024-09-02T05:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: Fun With SAS ODS Graphics: Matrix Plot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-Matrix-Plot/m-p/949114#M25092</link>
      <description>&lt;P&gt;I also found&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13585"&gt;@GraphGuy&lt;/a&gt;&amp;nbsp; a.k.a&amp;nbsp;&lt;A title="Posts by Robert Allison" href="https://blogs.sas.com/content/author/robertallison/" rel="author" target="_blank"&gt;Robert Allison&lt;/A&gt;&amp;nbsp;get this kind of graph at 2018 .&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sastraining/2018/11/26/creating-a-matrix-like-movie-scroll-animation-from-a-text-file/" target="_blank"&gt;https://blogs.sas.com/content/sastraining/2018/11/26/creating-a-matrix-like-movie-scroll-animation-from-a-text-file/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Oct 2024 08:44:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Fun-With-SAS-ODS-Graphics-Matrix-Plot/m-p/949114#M25092</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-10-27T08:44:38Z</dc:date>
    </item>
  </channel>
</rss>

