<?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: Plot all variables of all groups in one graph in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Plot-all-variables-of-all-groups-in-one-graph/m-p/671342#M20253</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13585"&gt;@GraphGuy&lt;/a&gt;! And thank you for all of your posts at Graphically Speaking. I learn so much from you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Jul 2020 11:37:08 GMT</pubDate>
    <dc:creator>PeterClemmensen</dc:creator>
    <dc:date>2020-07-22T11:37:08Z</dc:date>
    <item>
      <title>Plot all variables of all groups in one graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plot-all-variables-of-all-groups-in-one-graph/m-p/670889#M20241</link>
      <description>&lt;P&gt;Hi. I have a time series (monthly) data of 2 variables (cash, asset) for different groups (categorized by country - suburb - firm).&lt;/P&gt;&lt;P&gt;Now I would like to plot a line graph of these 2 variables for each group, and these lines need to be put in one graph only.&lt;/P&gt;&lt;P&gt;Could you please advise me on how I should do it? Thank you very much.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My dataset is like this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data graphdata;
input country $ suburb $ firm $ month $ cash asset;
datalines;
A A1 A2 Jan 25 32
A A1 A2 Feb 20 35
A A1 A2 Mar 11 12
A A1 A2 Apr 14 15
A A1 A3 Jan 1 2
A A1 A3 Feb 3 4
A A1 A3 Mar 5 6
A A1 A3 Apr 9 10
B B1 B2 Jan 11 12
B B1 B2 Feb 13 14
B B1 B2 Mar 15 16
B B1 B2 Apr 17 18
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Jul 2020 08:12:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plot-all-variables-of-all-groups-in-one-graph/m-p/670889#M20241</guid>
      <dc:creator>trungcva112</dc:creator>
      <dc:date>2020-07-21T08:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: Plot all variables of all groups in one graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plot-all-variables-of-all-groups-in-one-graph/m-p/670890#M20242</link>
      <description>&lt;P&gt;What do you want the graph to look like?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2020 08:24:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plot-all-variables-of-all-groups-in-one-graph/m-p/670890#M20242</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-07-21T08:24:49Z</dc:date>
    </item>
    <item>
      <title>Re: Plot all variables of all groups in one graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plot-all-variables-of-all-groups-in-one-graph/m-p/670892#M20243</link>
      <description>Hi. The graph should have 6 lines (3 lines for the variable "cash", 3 lines for "asset"), with "month" as x-axis. I just need the lines for variable "cash" to be in different color from variable "asset".</description>
      <pubDate>Tue, 21 Jul 2020 08:43:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plot-all-variables-of-all-groups-in-one-graph/m-p/670892#M20243</guid>
      <dc:creator>trungcva112</dc:creator>
      <dc:date>2020-07-21T08:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: Plot all variables of all groups in one graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plot-all-variables-of-all-groups-in-one-graph/m-p/670895#M20244</link>
      <description>&lt;P&gt;Do you want all three lines for Cash to be the same color? Or should each of the six lines have a different color?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2020 08:52:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plot-all-variables-of-all-groups-in-one-graph/m-p/670895#M20244</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-07-21T08:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: Plot all variables of all groups in one graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plot-all-variables-of-all-groups-in-one-graph/m-p/670896#M20245</link>
      <description>&lt;P&gt;Yeah, all 3 lines for cash should be the same color as I do not need to differentiate across groups. I just need to differentiate "cash" and "asset".&lt;/P&gt;&lt;P&gt;Also, the full dataset has thousands of groups, so it is no use to differentiate between groups.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2020 08:59:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plot-all-variables-of-all-groups-in-one-graph/m-p/670896#M20245</guid>
      <dc:creator>trungcva112</dc:creator>
      <dc:date>2020-07-21T08:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: Plot all variables of all groups in one graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plot-all-variables-of-all-groups-in-one-graph/m-p/670898#M20246</link>
      <description>&lt;P&gt;This should get you started&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data graphdata;
input country $ suburb $ firm $ month $ cash asset;
datalines;
A A1 A2 Jan 25 32
A A1 A2 Feb 20 35
A A1 A2 Mar 11 12
A A1 A2 Apr 14 15
A A1 A3 Jan 1 2
A A1 A3 Feb 3 4
A A1 A3 Mar 5 6
A A1 A3 Apr 9 10
B B1 B2 Jan 11 12
B B1 B2 Feb 13 14
B B1 B2 Mar 15 16
B B1 B2 Apr 17 18
;

data graphview / view=graphview;
   set graphdata;
   csf = catx(" ", country, suburb, firm);
run;

proc sgplot data=graphview noautolegend;
    series x=month y=cash / group=csf lineattrs=(color='red');
    series x=month y=asset / group=csf lineattrs=(color='blue');
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 Jul 2020 09:02:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plot-all-variables-of-all-groups-in-one-graph/m-p/670898#M20246</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-07-21T09:02:34Z</dc:date>
    </item>
    <item>
      <title>Re: Plot all variables of all groups in one graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plot-all-variables-of-all-groups-in-one-graph/m-p/671019#M20247</link>
      <description>&lt;P&gt;First thing, prepare to be disappointed as your "month" is not going to be sorted properly. Your first x value would be Apr , then Feb, Jan, Mar because that is the sort order for character values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want date-like values to sort properly then use an actual SAS date value and then display with an appropriate format.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2020 14:54:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plot-all-variables-of-all-groups-in-one-graph/m-p/671019#M20247</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-07-21T14:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: Plot all variables of all groups in one graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plot-all-variables-of-all-groups-in-one-graph/m-p/671339#M20250</link>
      <description>&lt;P&gt;Here's the output from draycut's code, for those who aren't in a situation where you can run the code easily:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="cash.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/47500i02278A3576530E5B/image-size/large?v=v2&amp;amp;px=999" role="button" title="cash.png" alt="cash.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 11:31:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plot-all-variables-of-all-groups-in-one-graph/m-p/671339#M20250</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2020-07-22T11:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: Plot all variables of all groups in one graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plot-all-variables-of-all-groups-in-one-graph/m-p/671340#M20251</link>
      <description>&lt;P&gt;Good point&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 11:36:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plot-all-variables-of-all-groups-in-one-graph/m-p/671340#M20251</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-07-22T11:36:00Z</dc:date>
    </item>
    <item>
      <title>Re: Plot all variables of all groups in one graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plot-all-variables-of-all-groups-in-one-graph/m-p/671342#M20253</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13585"&gt;@GraphGuy&lt;/a&gt;! And thank you for all of your posts at Graphically Speaking. I learn so much from you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 11:37:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plot-all-variables-of-all-groups-in-one-graph/m-p/671342#M20253</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2020-07-22T11:37:08Z</dc:date>
    </item>
    <item>
      <title>Re: Plot all variables of all groups in one graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Plot-all-variables-of-all-groups-in-one-graph/m-p/671648#M20281</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;- I agree in general, that the best/proper way to place the month names along the xasis it to use numeric or real-date values (to control the order), and then a format to make them 'appear' as the text month names ... but in this particular situation, the simple text month names seem to appear in the proper order (I assume they're appearing in data-order). So, as long as the data is arranged carefully (as in the sample data&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/181905"&gt;@trungcva112&lt;/a&gt;&amp;nbsp;posted), it might be ok to just use simple text. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 01:31:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Plot-all-variables-of-all-groups-in-one-graph/m-p/671648#M20281</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2020-07-23T01:31:42Z</dc:date>
    </item>
  </channel>
</rss>

