<?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: Produce multiple Plots base on a Variable in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Produce-multiple-Plots-base-on-a-Variable/m-p/358111#M12433</link>
    <description>&lt;P&gt;Write the code for one Site.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Make it a macro using a WHERE clause and parameter for SITE.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use a data step and CALL EXECUTE to execute it for every value. The CALL EXECUTE documentation has an example.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 12 May 2017 04:05:26 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2017-05-12T04:05:26Z</dc:date>
    <item>
      <title>Produce multiple Plots base on a Variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Produce-multiple-Plots-base-on-a-Variable/m-p/358102#M12432</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was hoping someone could give me a start. I have a dataset from which&amp;nbsp;I have created a sgpanel plot that is currently:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;panelby Site Season Year&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead what I want to do is to create a new&amp;nbsp;sgpanel plot for each of the Sites so they will be panelby Season Year. &amp;nbsp;I want it set up so that which sites and how many are in the data set won't matter ie the program will be able to work this out.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I'm assuming that I need to have something that gets a unique list from the variable Site and then loops over the sgpanel code to produce a plot for each site in the list?&amp;nbsp; Any suggestion on the easiest way to do this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using SAS Enterprise Guide Version 7.11 HF5&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;Jo&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2017 03:27:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Produce-multiple-Plots-base-on-a-Variable/m-p/358102#M12432</guid>
      <dc:creator>jo1</dc:creator>
      <dc:date>2017-05-12T03:27:44Z</dc:date>
    </item>
    <item>
      <title>Re: Produce multiple Plots base on a Variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Produce-multiple-Plots-base-on-a-Variable/m-p/358111#M12433</link>
      <description>&lt;P&gt;Write the code for one Site.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Make it a macro using a WHERE clause and parameter for SITE.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Use a data step and CALL EXECUTE to execute it for every value. The CALL EXECUTE documentation has an example.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2017 04:05:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Produce-multiple-Plots-base-on-a-Variable/m-p/358111#M12433</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-12T04:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: Produce multiple Plots base on a Variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Produce-multiple-Plots-base-on-a-Variable/m-p/358234#M12434</link>
      <description>&lt;P&gt;I suggest you only need to use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; proc sgpanel data=foo;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; by Site;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; panelby&amp;nbsp;&lt;SPAN&gt;Season Year;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; plot statements;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2017 14:01:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Produce-multiple-Plots-base-on-a-Variable/m-p/358234#M12434</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2017-05-12T14:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: Produce multiple Plots base on a Variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Produce-multiple-Plots-base-on-a-Variable/m-p/358238#M12436</link>
      <description>&lt;P&gt;Have you tried sorting your data by site and then using:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By Site;&lt;/P&gt;
&lt;P&gt;Panelby Season Year ;&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2017 14:06:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Produce-multiple-Plots-base-on-a-Variable/m-p/358238#M12436</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-05-12T14:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: Produce multiple Plots base on a Variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Produce-multiple-Plots-base-on-a-Variable/m-p/358328#M12448</link>
      <description>&lt;P&gt;I &amp;nbsp;just noticed that the SGPROCEDURES don't have BY listed in their Syntax, rather it's in a generic section above which I didn't realize initially.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The STAT/PROCS do list a BY in the documentation. The inconsistency is confusing :S&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2017 19:27:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Produce-multiple-Plots-base-on-a-Variable/m-p/358328#M12448</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-12T19:27:37Z</dc:date>
    </item>
    <item>
      <title>Re: Produce multiple Plots base on a Variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Produce-multiple-Plots-base-on-a-Variable/m-p/358418#M12452</link>
      <description>&lt;P&gt;The correct answer should be&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13856"&gt;@Jay54&lt;/a&gt;&amp;nbsp;not my suggestion of a macro. BY processing is more efficient.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 May 2017 05:02:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Produce-multiple-Plots-base-on-a-Variable/m-p/358418#M12452</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-13T05:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: Produce multiple Plots base on a Variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Produce-multiple-Plots-base-on-a-Variable/m-p/358419#M12453</link>
      <description>&lt;P&gt;The "By Site" option did work (although in the code "by" stayed coloured red as if there was an issue)&amp;nbsp;but probably is not that different a result than the "panelby Site Season Year".&amp;nbsp; The only difference&amp;nbsp;between these two is that&amp;nbsp;in the results it puts a page break between the set of plots for each site.&amp;nbsp; Why I was after each site done seperately is that the values are quite different and the sgpanel&amp;nbsp;produces a single range on the y-axis that covered all values for all sites, which made a lot of the variation within site not easily&amp;nbsp;visible.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For me the "Call execute" routine worked better as it produced a entirely new&amp;nbsp;plot for each site and therefore the range on the y-axis is appropriate for each individual site.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks heaps for the reponse thou, as I'm sure I'll have need to employ both options in further work and had not come across the by option before.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 13 May 2017 05:07:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Produce-multiple-Plots-base-on-a-Variable/m-p/358419#M12453</guid>
      <dc:creator>jo1</dc:creator>
      <dc:date>2017-05-13T05:07:03Z</dc:date>
    </item>
    <item>
      <title>Re: Produce multiple Plots base on a Variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Produce-multiple-Plots-base-on-a-Variable/m-p/358420#M12454</link>
      <description>See the message I just posted on why the macro worked better for me in this situation - perhaps not as efficient but the result is more appropriate for what I wantd.</description>
      <pubDate>Sat, 13 May 2017 05:10:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Produce-multiple-Plots-base-on-a-Variable/m-p/358420#M12454</guid>
      <dc:creator>jo1</dc:creator>
      <dc:date>2017-05-13T05:10:26Z</dc:date>
    </item>
    <item>
      <title>Re: Produce multiple Plots base on a Variable</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Produce-multiple-Plots-base-on-a-Variable/m-p/358436#M12457</link>
      <description>&lt;P&gt;Proc SGPANEL BY Site will also produce a new graph per site. &amp;nbsp;You should use whichever method works for you best. &amp;nbsp;You can also use more classifiers on the BY variable.&lt;/P&gt;</description>
      <pubDate>Sat, 13 May 2017 13:51:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Produce-multiple-Plots-base-on-a-Variable/m-p/358436#M12457</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2017-05-13T13:51:45Z</dc:date>
    </item>
  </channel>
</rss>

