<?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 How to do n-by-m plot with SGPLOT?! in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-do-n-by-m-plot-with-SGPLOT/m-p/978707#M378676</link>
    <description>&lt;P&gt;I have one summarized time-series dataset with two cat-vars, and like to do n-by-M plot with SGPLOT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _temp;
do grp1=1 to 3;
	do grp2=1 to 3;
		do ind=1 to 100;
			y=grp1*10+grp2+sin(ind/10); output;
		end;
	end;
end;
run;quit;

ods layout gridded columns=3 rows=3 advance=proc;
	proc sgplot data=_temp;
			by grp1 grp2;
			series x=ind y=y/  lineattrs=( color=red thickness=2 pattern=solid);  
	run;quit;
ods layout end;	&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Somehow show up and 1*(n*m). Anyone can help?!&lt;/P&gt;</description>
    <pubDate>Wed, 12 Nov 2025 08:26:03 GMT</pubDate>
    <dc:creator>hellohere</dc:creator>
    <dc:date>2025-11-12T08:26:03Z</dc:date>
    <item>
      <title>How to do n-by-m plot with SGPLOT?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-do-n-by-m-plot-with-SGPLOT/m-p/978707#M378676</link>
      <description>&lt;P&gt;I have one summarized time-series dataset with two cat-vars, and like to do n-by-M plot with SGPLOT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _temp;
do grp1=1 to 3;
	do grp2=1 to 3;
		do ind=1 to 100;
			y=grp1*10+grp2+sin(ind/10); output;
		end;
	end;
end;
run;quit;

ods layout gridded columns=3 rows=3 advance=proc;
	proc sgplot data=_temp;
			by grp1 grp2;
			series x=ind y=y/  lineattrs=( color=red thickness=2 pattern=solid);  
	run;quit;
ods layout end;	&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Somehow show up and 1*(n*m). Anyone can help?!&lt;/P&gt;</description>
      <pubDate>Wed, 12 Nov 2025 08:26:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-do-n-by-m-plot-with-SGPLOT/m-p/978707#M378676</guid>
      <dc:creator>hellohere</dc:creator>
      <dc:date>2025-11-12T08:26:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to do n-by-m plot with SGPLOT?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-do-n-by-m-plot-with-SGPLOT/m-p/978708#M378677</link>
      <description>&lt;P&gt;If do as below, it shows up n-by-M. BUT grp1 info is lost.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods layout gridded columns=3 rows=3 advance=proc;
	proc sgplot data=_temp(where=(grp1=1));
			by grp2;
			series x=ind y=y/  lineattrs=( color=red thickness=2 pattern=solid);  
	run;quit;
	proc sgplot data=_temp(where=(grp1=2));
			by grp2;
			series x=ind y=y/  lineattrs=( color=red thickness=2 pattern=solid);  
	run;quit;
	proc sgplot data=_temp(where=(grp1=3));
			by grp2;
			series x=ind y=y/  lineattrs=( color=red thickness=2 pattern=solid);  
	run;quit;
ods layout end;	&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Anyway to show up grp1 info, with grp2 value?!&lt;/P&gt;</description>
      <pubDate>Wed, 12 Nov 2025 08:47:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-do-n-by-m-plot-with-SGPLOT/m-p/978708#M378677</guid>
      <dc:creator>hellohere</dc:creator>
      <dc:date>2025-11-12T08:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to do n-by-m plot with SGPLOT?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-do-n-by-m-plot-with-SGPLOT/m-p/978712#M378678</link>
      <description>&lt;P&gt;You want this ?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _temp;
do grp1=1 to 3;
	do grp2=1 to 3;
		do ind=1 to 100;
			y=grp1*10+grp2+sin(ind/10); output;
		end;
	end;
end;
run;quit;


proc sgpanel data=_temp;
panelby grp1 grp2/layout=lattice;
series x=ind y=y/  lineattrs=( color=red thickness=2 pattern=solid);  
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1762938276815.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/111243iC880F614E8C0151D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1762938276815.png" alt="Ksharp_0-1762938276815.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Nov 2025 09:04:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-do-n-by-m-plot-with-SGPLOT/m-p/978712#M378678</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-11-12T09:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to do n-by-m plot with SGPLOT?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-do-n-by-m-plot-with-SGPLOT/m-p/978714#M378679</link>
      <description>&lt;P&gt;And your code should look like this .&lt;/P&gt;
&lt;PRE&gt;ods layout gridded columns=3 rows=3 advance=&lt;STRONG&gt;table&lt;/STRONG&gt;;
&lt;STRONG&gt;ods graphics /width=300px height=200px;&lt;/STRONG&gt;
	proc sgplot data=_temp;
			by grp1 grp2;
			series x=ind y=y/  lineattrs=( color=red thickness=2 pattern=solid);  
	run;quit;
ods layout end;	&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1762938667981.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/111244i1D4D1881804C0E7E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1762938667981.png" alt="Ksharp_0-1762938667981.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Nov 2025 09:11:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-do-n-by-m-plot-with-SGPLOT/m-p/978714#M378679</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2025-11-12T09:11:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to do n-by-m plot with SGPLOT?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-do-n-by-m-plot-with-SGPLOT/m-p/978782#M378685</link>
      <description>&lt;P&gt;Why sgplot?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would tend to use SGPANEL such as&lt;/P&gt;
&lt;PRE&gt;	proc sgpanel data=_temp;
			panelby grp1 grp2/layout=lattice;
			series x=ind y=y/  lineattrs=( color=red thickness=2 pattern=solid);  
	run;quit;&lt;/PRE&gt;
&lt;P&gt;Which, barring many values of grp1 and grp2 automatically creates the correct number of rows and columns. Note that Layout=lattice is for exactly 2 Panelby variables.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Nov 2025 03:07:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-do-n-by-m-plot-with-SGPLOT/m-p/978782#M378685</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2025-11-13T03:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to do n-by-m plot with SGPLOT?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-do-n-by-m-plot-with-SGPLOT/m-p/978810#M378686</link>
      <description>&lt;P&gt;This is better.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Nov 2025 11:13:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-do-n-by-m-plot-with-SGPLOT/m-p/978810#M378686</guid>
      <dc:creator>hellohere</dc:creator>
      <dc:date>2025-11-13T11:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to do n-by-m plot with SGPLOT?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-do-n-by-m-plot-with-SGPLOT/m-p/978811#M378687</link>
      <description>&lt;P&gt;Thanks. I bet it works.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Nov 2025 11:14:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-do-n-by-m-plot-with-SGPLOT/m-p/978811#M378687</guid>
      <dc:creator>hellohere</dc:creator>
      <dc:date>2025-11-13T11:14:34Z</dc:date>
    </item>
  </channel>
</rss>

