<?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: Proc Template grided plots in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Proc-Template-grided-plots/m-p/675376#M20355</link>
    <description>&lt;P&gt;&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2017/05/29/advanced-ods-graphics-gtl-expressions/" target="_blank"&gt;https://blogs.sas.com/content/graphicallyspeaking/2017/05/29/advanced-ods-graphics-gtl-expressions/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See this post. Rather than plotting a variable, I plot an expression that excludes some observations:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The DATA step reads the graph template from the file&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;temp.temp.&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;The CALL EXECUTE statements write code to a buffer and then submit that code to SAS when the DATA step concludes. In this case, the DATA step submits a PROC TEMPLATE statement, a statement that has two modified options, and all of the other statements that are stored in the template file. When the DATA step finds an X=CORRX option it replaces it with:&lt;/P&gt;
&lt;DIV class="wp_syntax"&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="code"&gt;
&lt;PRE class="text"&gt;   x=eval(ifn(corrgroup = 'Observation', ., corrx))&lt;/PRE&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;P&gt;Similarly, it replaces y=CORRY with:&lt;/P&gt;
&lt;DIV class="wp_syntax"&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="code"&gt;
&lt;PRE class="text"&gt;   y=eval(ifn(corrgroup = 'Observation', ., corry))&lt;/PRE&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;</description>
    <pubDate>Sat, 08 Aug 2020 11:21:31 GMT</pubDate>
    <dc:creator>WarrenKuhfeld</dc:creator>
    <dc:date>2020-08-08T11:21:31Z</dc:date>
    <item>
      <title>Proc Template grided plots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-Template-grided-plots/m-p/675349#M20354</link>
      <description>&lt;P&gt;I am fairly new to using PROC TEMPLATE. I want to use it to plot multiple charts (scatter plots with other overlays), arranged in a grid pattern, and output to PDF. I have worked out how to plot to grids, and output to PDF, but I don't know&amp;nbsp;how I can conditionally specify which rows in the data is used for each plot, so for example I want to plot a scatterplot of A, a separate scatterplot of B, and so on, arranging them in a 2 by 3 grid in landscape orientation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried using the GTL conditional logic with macros to generate multiple scatterplot statements conditional on Category, but couldn't get it to work.&amp;nbsp;From what I gather I cannot use conditional statements to control which rows I want to plot. Is this correct? I then tried using conditional statements with macros on the PROC RENDER step, but it no longer gives me the grid pattern I specified in PROC TEMPLATE, and so I have concluded I need to have one PROC RENDER call. Is this correct?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Finally, this has led me to the conclusion that I have&amp;nbsp;to transpose the data from a long file into a wide file. However, I have many Categories and it would make a data very wide. Am I on the right track at this stage, or are there more elegant solutions I have missed?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My data has the following general form:&lt;/P&gt;&lt;P&gt;Category&amp;nbsp; X&amp;nbsp; Y&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp; 10&lt;/P&gt;&lt;P&gt;A&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp; 15&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp; 100&lt;/P&gt;&lt;P&gt;B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;150&lt;/P&gt;&lt;P&gt;...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&amp;nbsp; ...&lt;/P&gt;&lt;P&gt;etc&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; etc etc&lt;/P&gt;</description>
      <pubDate>Sat, 08 Aug 2020 00:18:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-Template-grided-plots/m-p/675349#M20354</guid>
      <dc:creator>tiger86</dc:creator>
      <dc:date>2020-08-08T00:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Template grided plots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-Template-grided-plots/m-p/675376#M20355</link>
      <description>&lt;P&gt;&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2017/05/29/advanced-ods-graphics-gtl-expressions/" target="_blank"&gt;https://blogs.sas.com/content/graphicallyspeaking/2017/05/29/advanced-ods-graphics-gtl-expressions/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See this post. Rather than plotting a variable, I plot an expression that excludes some observations:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The DATA step reads the graph template from the file&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;temp.temp.&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;The CALL EXECUTE statements write code to a buffer and then submit that code to SAS when the DATA step concludes. In this case, the DATA step submits a PROC TEMPLATE statement, a statement that has two modified options, and all of the other statements that are stored in the template file. When the DATA step finds an X=CORRX option it replaces it with:&lt;/P&gt;
&lt;DIV class="wp_syntax"&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="code"&gt;
&lt;PRE class="text"&gt;   x=eval(ifn(corrgroup = 'Observation', ., corrx))&lt;/PRE&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;
&lt;P&gt;Similarly, it replaces y=CORRY with:&lt;/P&gt;
&lt;DIV class="wp_syntax"&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="code"&gt;
&lt;PRE class="text"&gt;   y=eval(ifn(corrgroup = 'Observation', ., corry))&lt;/PRE&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;/DIV&gt;</description>
      <pubDate>Sat, 08 Aug 2020 11:21:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-Template-grided-plots/m-p/675376#M20355</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2020-08-08T11:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Template grided plots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-Template-grided-plots/m-p/675384#M20356</link>
      <description>&lt;P&gt;Before you spend too much time on the GTL, ask yourself whether you can use PROC SGPANEL to create these scatter plots with overlays. For example, the following call creates a panel of scatter plots and overlays regression curves:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgpanel data=sashelp.cars(where=(Type^='Hybrid'));
panelby Type;
scatter x=weight y=MPG_City;
reg x=weight y=MPG_City / degree=2 nomarkers;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 08 Aug 2020 13:27:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-Template-grided-plots/m-p/675384#M20356</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2020-08-08T13:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Template grided plots</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Proc-Template-grided-plots/m-p/675446#M20358</link>
      <description>&lt;P&gt;Thanks Rick. My plots (partial dependency plots) need to have independent axes (xaxis, yaxis, and yaxis2), while I understand PROC SGPANEL allows one axis to be independent at a time.&lt;/P&gt;</description>
      <pubDate>Sun, 09 Aug 2020 00:37:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Proc-Template-grided-plots/m-p/675446#M20358</guid>
      <dc:creator>tiger86</dc:creator>
      <dc:date>2020-08-09T00:37:17Z</dc:date>
    </item>
  </channel>
</rss>

