<?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: how to sort every colunm in Lasagna plot in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/how-to-sort-every-colunm-in-Lasagna-plot/m-p/526776#M17659</link>
    <description>&lt;P&gt;In case it is helpful, I discuss &lt;A href="https://blogs.sas.com/content/iml/2016/06/08/lasagna-plot-in-sas.html" target="_self"&gt;how to sort rows of the lasagna plot &lt;/A&gt;in a blog post&amp;nbsp;and provide an example. I used PROC IML, but I think you can do something similar by using the CALL SORT function in the DATA step to sort each row of the data independently. You'll have to set up an array&amp;nbsp;that references the variables/columns.&lt;/P&gt;</description>
    <pubDate>Sun, 13 Jan 2019 20:46:48 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2019-01-13T20:46:48Z</dc:date>
    <item>
      <title>how to sort every colunm in Lasagna plot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/how-to-sort-every-colunm-in-Lasagna-plot/m-p/526641#M17654</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to draw lasagna plot which shows the changeable of categories over time.&lt;/P&gt;&lt;P&gt;I wrote code as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc template;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; define statgraph heatmapparm;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; begingraph;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;layout overlay;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;heatmapparm x=x1 y=y1 colorresponse=z1 /&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;name="heatmapparm" xbinaxis=false ybinaxis=false colormodel=(green yellow orange) XGAP=2;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;continuouslegend "heatmapparm" / location=outside valign=bottom;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; endlayout;&lt;BR /&gt;endgraph;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;proc sgrender data=dataset template=heatmapparm;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then I got a graph like the following:&lt;/P&gt;&lt;P&gt;However, I want to sort every column which would be easier to see the changeable. Is there any solution for this?&lt;/P&gt;&lt;P&gt;Thank you in advance.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="4$EZU}_DJ$O%QJWBK}4_W~1.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/26232iA9B8EC2C638751CA/image-size/large?v=v2&amp;amp;px=999" role="button" title="4$EZU&amp;amp;#125;_DJ$O%QJWBK&amp;amp;#125;4_W~1.png" alt="4$EZU&amp;amp;#125;_DJ$O%QJWBK&amp;amp;#125;4_W~1.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Jan 2019 19:34:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/how-to-sort-every-colunm-in-Lasagna-plot/m-p/526641#M17654</guid>
      <dc:creator>Jie111</dc:creator>
      <dc:date>2019-01-12T19:34:11Z</dc:date>
    </item>
    <item>
      <title>Re: how to sort every colunm in Lasagna plot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/how-to-sort-every-colunm-in-Lasagna-plot/m-p/526645#M17655</link>
      <description>&lt;P&gt;You would need to sort your data by x1 z1_0 z1_1 ... z1_20, where z1_n is the value of z1 when x1=n. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Jan 2019 20:14:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/how-to-sort-every-colunm-in-Lasagna-plot/m-p/526645#M17655</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2019-01-12T20:14:12Z</dc:date>
    </item>
    <item>
      <title>Re: how to sort every colunm in Lasagna plot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/how-to-sort-every-colunm-in-Lasagna-plot/m-p/526647#M17656</link>
      <description>Thank you for the reply.&lt;BR /&gt;Actually I did this:&lt;BR /&gt;PROC SORT DATA=RUSH.rush_long;&lt;BR /&gt;by fu_year dcfdx_g;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;But it only impacts the first column (z1_0). I do not know how to sort other columns.</description>
      <pubDate>Sat, 12 Jan 2019 20:59:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/how-to-sort-every-colunm-in-Lasagna-plot/m-p/526647#M17656</guid>
      <dc:creator>Jie111</dc:creator>
      <dc:date>2019-01-12T20:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: how to sort every colunm in Lasagna plot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/how-to-sort-every-colunm-in-Lasagna-plot/m-p/526776#M17659</link>
      <description>&lt;P&gt;In case it is helpful, I discuss &lt;A href="https://blogs.sas.com/content/iml/2016/06/08/lasagna-plot-in-sas.html" target="_self"&gt;how to sort rows of the lasagna plot &lt;/A&gt;in a blog post&amp;nbsp;and provide an example. I used PROC IML, but I think you can do something similar by using the CALL SORT function in the DATA step to sort each row of the data independently. You'll have to set up an array&amp;nbsp;that references the variables/columns.&lt;/P&gt;</description>
      <pubDate>Sun, 13 Jan 2019 20:46:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/how-to-sort-every-colunm-in-Lasagna-plot/m-p/526776#M17659</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2019-01-13T20:46:48Z</dc:date>
    </item>
    <item>
      <title>Re: how to sort every colunm in Lasagna plot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/how-to-sort-every-colunm-in-Lasagna-plot/m-p/550007#M17993</link>
      <description>&lt;P&gt;Thank you very much. I got it. Attached with my code in case someone has the same question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ods graphics / width=500px height=650px;&lt;BR /&gt;proc iml;&lt;BR /&gt;varName = "bmi_lasa1":"bmi_lasa5";&lt;BR /&gt;use bmi_lasag ;&amp;nbsp;&lt;BR /&gt;read all var varName into X[rowname=l_pnr1];&amp;nbsp;&lt;BR /&gt;close bmi_lasag;&lt;BR /&gt;&lt;BR /&gt;palette = "CXFFFFFF" || palette("YLORRD", 4); /* palette from colorbrewer.org */&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;call sort (x,{1 2 3 4 5 },{1 2 3 4 5 }); /*this part is the answer*/&lt;/STRONG&gt;&lt;BR /&gt;Sort2 = X; /* copy original data */&lt;/P&gt;&lt;P&gt;call heatmapcont(Sort2) xvalues=1:5&lt;BR /&gt;displayoutlines=0 colorramp=palette;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Apr 2019 16:31:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/how-to-sort-every-colunm-in-Lasagna-plot/m-p/550007#M17993</guid>
      <dc:creator>Jie111</dc:creator>
      <dc:date>2019-04-10T16:31:59Z</dc:date>
    </item>
  </channel>
</rss>

