<?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: Plotting 4 Ys in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-2X2-Chart/m-p/830080#M327985</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods graphics/height=3in width=4in;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can play with the width and height to find the numbers that look best in your situation.&lt;/P&gt;</description>
    <pubDate>Wed, 24 Aug 2022 14:16:05 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2022-08-24T14:16:05Z</dc:date>
    <item>
      <title>How to 2X2 Chart ?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-2X2-Chart/m-p/823692#M325262</link>
      <description>&lt;P&gt;Say there is dataset contains X and 4Ys(Y1, Y2,Y3, and Y4).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How to generate a chart with 4-sub-charts (Y1~X, Y2~X, Y3~X and Y4~X)?!&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jul 2022 10:57:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-2X2-Chart/m-p/823692#M325262</guid>
      <dc:creator>hellohere</dc:creator>
      <dc:date>2022-07-17T10:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to 2X2 Chart ?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-2X2-Chart/m-p/823693#M325263</link>
      <description>&lt;P&gt;Explain in more detail. Show us a sample of the input data. Show us a mocked up version of the desired output.&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jul 2022 11:05:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-2X2-Chart/m-p/823693#M325263</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-07-17T11:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to 2X2 Chart ?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-2X2-Chart/m-p/823704#M325266</link>
      <description>&lt;P&gt;One X with 4 Ys. One way is to plot 4Ys(below) with X within one chart.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When 4 Ys' Range varies and plot together does not make sense,&lt;/P&gt;
&lt;P&gt;I like to make one chart with 4 carpets, each charting one Y with the same X&lt;/P&gt;
&lt;P&gt;(SAS generate one Picture)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data temp;&lt;BR /&gt;do x=1 to 20;&lt;BR /&gt;y1=ranuni(1);y2=ranuni(2);y3=ranuni(3);y4=ranuni(4);&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;quit;&lt;/P&gt;
&lt;P&gt;symbol1 interpol=join;symbol2 interpol=join;symbol3 interpol=join;symbol4 interpol=join;&lt;BR /&gt;proc gplot data=temp;&lt;BR /&gt;plot (y1 y2 y3 y4)*x/legend overlay;&lt;BR /&gt;run;quit;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jul 2022 12:33:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-2X2-Chart/m-p/823704#M325266</guid>
      <dc:creator>hellohere</dc:creator>
      <dc:date>2022-07-17T12:33:37Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting 4 Ys</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-2X2-Chart/m-p/823705#M325267</link>
      <description>&lt;P&gt;First, your subject line is very misleading, there is no 2x2 charting in your question, and this confused me greatly. I suggest you go back to your original post and change it so that it has a more meaningful subject line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Next, you provide data that really doesn't illustrate the problem. There's no different range of these 4 Y variables and they all fit nicely on one plot with one y-axis. As a recommendation to you, it is very helpful to provide data that illustrates your problem. It's never a good idea to make us guess.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Nevertheless at the risk of guessing wrong, here's some data that maybe closer to what you described, and a potential plot that might look better — but again, I am requesting that you tell us what you want instead of making us guess. Be specific, be detailed, be clear.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data temp;
do x=1 to 20;
y1=ranuni(1);
y2=10*ranuni(2);
y3=100*ranuni(3);
y4=1000*ranuni(4);
output;
end;
run;

proc sgplot data=temp;
series x=x y=y1;
series x=x y=y2;
series x=x y=y3;
series x=x y=y4;
yaxis type=log logstyle=logexpand logbase=10;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jul 2022 12:46:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-2X2-Chart/m-p/823705#M325267</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-07-17T12:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting 4 Ys</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-2X2-Chart/m-p/823711#M325271</link>
      <description>&lt;P&gt;What wanted is stich the 4 plots into one(one pic/jpg), so that 4 takes four corners with the&lt;/P&gt;
&lt;P&gt;final chart(top_left, top_right, bottom_left and bottom_right).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc gplot data=sashelp.applianc(where=(cycle&amp;lt;=20));&lt;BR /&gt;plot units_1*cycle/legend overlay;&lt;BR /&gt;run;quit;&lt;BR /&gt;proc gplot data=sashelp.applianc(where=(cycle&amp;lt;=20));&lt;BR /&gt;plot units_2*cycle/legend overlay;&lt;BR /&gt;run;quit;&lt;BR /&gt;proc gplot data=sashelp.applianc(where=(cycle&amp;lt;=20));&lt;BR /&gt;plot units_3*cycle/legend overlay;&lt;BR /&gt;run;quit;&lt;BR /&gt;proc gplot data=sashelp.applianc(where=(cycle&amp;lt;=20));&lt;BR /&gt;plot units_4*cycle/legend overlay;&lt;BR /&gt;run;quit;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jul 2022 13:40:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-2X2-Chart/m-p/823711#M325271</guid>
      <dc:creator>hellohere</dc:creator>
      <dc:date>2022-07-17T13:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting 4 Ys</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-2X2-Chart/m-p/823714#M325274</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods layout gridded columns=2 rows=2 advance=proc;
proc sgplot data=sashelp.applianc(where=(cycle&amp;lt;=20));
scatter y=units_1 x=cycle;
run;
proc sgplot data=sashelp.applianc(where=(cycle&amp;lt;=20));
scatter y=units_2 x=cycle;
run;
proc sgplot data=sashelp.applianc(where=(cycle&amp;lt;=20));
scatter y=units_3 x=cycle;
run;
proc sgplot data=sashelp.applianc(where=(cycle&amp;lt;=20));
scatter y=units_4 x=cycle;
run;
ods layout end;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 17 Jul 2022 14:06:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-2X2-Chart/m-p/823714#M325274</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-07-17T14:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to 2X2 Chart ?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-2X2-Chart/m-p/823821#M325333</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data temp;
do x=1 to 20;
y1=ranuni(1);
y2=10*ranuni(2);
y3=100*ranuni(3);
y4=1000*ranuni(4);
output;
end;
run;

proc sgscatter data=temp;
plot (y1-y4)*x;
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-1658148642831.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/73393i17A255053CDFBA95/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1658148642831.png" alt="Ksharp_0-1658148642831.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2022 12:50:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-2X2-Chart/m-p/823821#M325333</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-07-18T12:50:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to 2X2 Chart ?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-2X2-Chart/m-p/824770#M325744</link>
      <description>This is the one, one picture. Thanks,</description>
      <pubDate>Thu, 21 Jul 2022 20:09:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-2X2-Chart/m-p/824770#M325744</guid>
      <dc:creator>hellohere</dc:creator>
      <dc:date>2022-07-21T20:09:49Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting 4 Ys</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-2X2-Chart/m-p/830073#M327981</link>
      <description>any way to enforce the size of the outcome picture?! THX&lt;BR /&gt;See, stitch this way, 4 picture together,  you still need scroll down-up-left-right to see all details.&lt;BR /&gt;If just fit the SAS OUTPUR window and no need to scroll, that would be perfect.</description>
      <pubDate>Wed, 24 Aug 2022 13:36:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-2X2-Chart/m-p/830073#M327981</guid>
      <dc:creator>hellohere</dc:creator>
      <dc:date>2022-08-24T13:36:00Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting 4 Ys</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-2X2-Chart/m-p/830080#M327985</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods graphics/height=3in width=4in;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can play with the width and height to find the numbers that look best in your situation.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 14:16:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-2X2-Chart/m-p/830080#M327985</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-08-24T14:16:05Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting 4 Ys</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-2X2-Chart/m-p/830089#M327992</link>
      <description>Thanks, It almost saved my day. BUT I tried below with varied inch #, the outcome picture &lt;BR /&gt;is same size... any help?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;data temp;&lt;BR /&gt;do x=1 to 20;&lt;BR /&gt;y1=ranuni(1);&lt;BR /&gt;y2=10*ranuni(2);&lt;BR /&gt;y3=100*ranuni(3);&lt;BR /&gt;y4=1000*ranuni(4);&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;ods layout gridded columns=2 rows=2 advance=proc;&lt;BR /&gt;ods graphics/height=1in width=2in;&lt;BR /&gt;proc gplot data=temp; plot y1*x; run;&lt;BR /&gt;proc gplot data=temp; plot y2*x; run;&lt;BR /&gt;proc gplot data=temp; plot y3*x; run;&lt;BR /&gt;proc gplot data=temp; plot y4*x; run;&lt;BR /&gt;ods layout end;</description>
      <pubDate>Wed, 24 Aug 2022 14:45:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-2X2-Chart/m-p/830089#M327992</guid>
      <dc:creator>hellohere</dc:creator>
      <dc:date>2022-08-24T14:45:31Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting 4 Ys</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-2X2-Chart/m-p/830098#M327997</link>
      <description>&lt;P&gt;You need to use PROC SGPLOT and the proper syntax in the SCATTER or SERIES command.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This will not work with PROC GPLOT.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 15:08:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-2X2-Chart/m-p/830098#M327997</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-08-24T15:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting 4 Ys</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-2X2-Chart/m-p/830104#M328003</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;You need to use PROC SGPLOT and the proper syntax in the SCATTER or SERIES command.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This will not work with PROC GPLOT.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;At least not without the headaches of Proc Template to create the display template and Proc GREPLAY to associate each already create plot with a designated space in the template.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 15:29:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-2X2-Chart/m-p/830104#M328003</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-08-24T15:29:57Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting 4 Ys</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-2X2-Chart/m-p/830106#M328004</link>
      <description>&lt;P&gt;PROC TEMPLATE + PROC GREPLAY is needed to replace ODS LAYOUT GRIDDED. I don't think that was clear from what you wrote.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The simplicity of ODS LAYOUT GRIDDED seems to win hands down here.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 15:33:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-2X2-Chart/m-p/830106#M328004</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-08-24T15:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to 2X2 Chart ?!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-2X2-Chart/m-p/830109#M328005</link>
      <description>&lt;P&gt;Another approach may be to not create multiple variables to plot but add an indicator variable as to source/purpose/whatever and use SGPANEL to create one graph panel for each value of the Panelby variable(s).&lt;/P&gt;
&lt;PRE&gt;data temp;
do x=1 to 20;
y1=ranuni(1);
y2=10*ranuni(2);
y3=100*ranuni(3);
y4=1000*ranuni(4);
output;
end;
run;

data toplot;
   set temp;
   array ys(*) y:;
   do i=1 to dim(ys);
      var=vname(ys[i]);
      value=ys[i];
      output;
   end;
   keep x var value;
run;

proc sgpanel data=toplot;
   panelby var /columns=2 rows=2 
                onepanel uniscale=column
   ;
   scatter x=x y=value;
run;&lt;/PRE&gt;
&lt;P&gt;Or SGPLOT and group to overlay&lt;/P&gt;
&lt;PRE&gt;proc sgplot data=toplot;
   ;
   scatter x=x y=value/group=var;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 24 Aug 2022 15:38:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-2X2-Chart/m-p/830109#M328005</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-08-24T15:38:46Z</dc:date>
    </item>
    <item>
      <title>Re: Plotting 4 Ys</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-2X2-Chart/m-p/832069#M328867</link>
      <description>Any way to save the picture with specified filename and file location, such as c:\mypic\_pic_today_01.jpg/png ?! Thanks,</description>
      <pubDate>Wed, 07 Sep 2022 02:41:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-2X2-Chart/m-p/832069#M328867</guid>
      <dc:creator>hellohere</dc:creator>
      <dc:date>2022-09-07T02:41:35Z</dc:date>
    </item>
  </channel>
</rss>

