<?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 SGPLOT for multiple variables in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-for-multiple-variables/m-p/338932#M11779</link>
    <description>&lt;P&gt;Hi there!&lt;/P&gt;&lt;P&gt;I'm trying to draw some plot using proc sgplot;&lt;/P&gt;&lt;P&gt;for one variable, the code is as the following:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data= plot;
series y=A1 x=variable;
run;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However since there are options like colors following the series, and I actually want 10 series (y=a1, a2... a10) of y in the plot. Is there any easier way to draw these series of plots rather than writing 10 series?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 07 Mar 2017 18:41:14 GMT</pubDate>
    <dc:creator>joseph626</dc:creator>
    <dc:date>2017-03-07T18:41:14Z</dc:date>
    <item>
      <title>SGPLOT for multiple variables</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-for-multiple-variables/m-p/338932#M11779</link>
      <description>&lt;P&gt;Hi there!&lt;/P&gt;&lt;P&gt;I'm trying to draw some plot using proc sgplot;&lt;/P&gt;&lt;P&gt;for one variable, the code is as the following:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data= plot;
series y=A1 x=variable;
run;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However since there are options like colors following the series, and I actually want 10 series (y=a1, a2... a10) of y in the plot. Is there any easier way to draw these series of plots rather than writing 10 series?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 18:41:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-for-multiple-variables/m-p/338932#M11779</guid>
      <dc:creator>joseph626</dc:creator>
      <dc:date>2017-03-07T18:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT for multiple variables</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-for-multiple-variables/m-p/338936#M11780</link>
      <description>&lt;P&gt;Often what your are thinking of requires restructuring your data so you can use a Group option.&lt;/P&gt;
&lt;P&gt;The data should look like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;X&amp;nbsp; Y Group&lt;/P&gt;
&lt;P&gt;1&amp;nbsp;&amp;nbsp; 1&amp;nbsp; A1&lt;/P&gt;
&lt;P&gt;2&amp;nbsp;&amp;nbsp; 3&amp;nbsp; A1&lt;/P&gt;
&lt;P&gt;1&amp;nbsp;&amp;nbsp; 5&amp;nbsp; A2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc transpose may work for that.&lt;/P&gt;
&lt;P&gt;Then your sgplot code would look like&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="token procnames"&gt;proc&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;sgplot&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;data&lt;/SPAN&gt;&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token procnames"&gt;plot&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; series y&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;Y x&lt;SPAN class="token operator"&gt;=&lt;/SPAN&gt;X / group=group&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN class="token procnames"&gt;run&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 18:47:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-for-multiple-variables/m-p/338936#M11780</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-03-07T18:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT for multiple variables</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-for-multiple-variables/m-p/338938#M11781</link>
      <description>&lt;P&gt;If you have multiple columns, one for each response, you have two options:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Use a series plot per column. &amp;nbsp;Using Cycleattrs, colors will be set differently for each series automatically.&lt;/LI&gt;
&lt;LI&gt;Transpose your data so you have a GROUP variable that has each series id. &amp;nbsp;Then have only one column for response. &amp;nbsp;Then you can use one SERIES statement with GROUP option. &amp;nbsp;This is the preferred way.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;See&amp;nbsp;&lt;A href="http://blogs.sas.com/content/graphicallyspeaking/2015/06/28/attributes-priority-for-the-inquiring-mind/&amp;nbsp;" target="_blank"&gt;http://blogs.sas.com/content/graphicallyspeaking/2015/06/28/attributes-priority-for-the-inquiring-mind/&amp;nbsp;&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 18:47:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-for-multiple-variables/m-p/338938#M11781</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2017-03-07T18:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT for multiple variables</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-for-multiple-variables/m-p/338945#M11782</link>
      <description>&lt;P&gt;See this article on &lt;A href="http://blogs.sas.com/content/iml/2015/02/25/plotting-multiple-series-transforming-data-from-wide-to-long.html" target="_self"&gt;plotting multiple series&lt;/A&gt;. You might also want to be aware of some of the issues involved in &lt;A href="http://blogs.sas.com/content/iml/2016/06/02/create-spaghetti-plots-in-sas.html" target="_self"&gt;Spaghetti Plots.&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 20:05:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-for-multiple-variables/m-p/338945#M11782</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-03-07T20:05:42Z</dc:date>
    </item>
  </channel>
</rss>

