<?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 can I create a .png file with gridded output? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-can-I-create-a-png-file-with-gridded-output/m-p/570051#M18395</link>
    <description>&lt;P&gt;I am using SAS 9.4 1M6 on a Windows 10 machine.&amp;nbsp; I have a program that creates what I want in HTML:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods listing gpath = "c:\writing\nonfiction\glm book";
ods graphics /imagename = "anscombe1sas" imagefmt = png;
ods layout gridded columns = 2 rows = 2;
ods region;
proc sgplot data = anscombe;
 scatter x = x1 y = y1;
 lineparm x = 0 y = 3.000090909 slope = 0.500090909/curvelabel = "OLS fit";
 lineparm x = 0 y = 3.24 slope = 0.48/curvelabel = "Quantreg for median" lineattrs = (color = "red");
run;

ods region;
proc sgplot data = anscombe;
 scatter x = x1 y = y2;
 lineparm x = 0 y = 3.000909091 slope = 0.5/curvelabel = "OLS fit";
 lineparm x = 0 y = 3.13 slope = 0.5/curvelabel = "Quantreg for median" lineattrs = (color = "red");
run;


ods region;
proc sgplot data = anscombe;
 scatter x = x1 y = y3;
 lineparm x = 0 y = 3.002454545 slope = 0.5/curvelabel = "OLS fit";
 lineparm x = 0 y = 4.01 slope = 0.345/curvelabel = "Quantreg for median" lineattrs = (color = "red");
run;


ods region;
proc sgplot data = anscombe;
 scatter x = x1 y = y4;
 lineparm x = 0 y = 9.231363636 slope = -0.192272727/curvelabel = "OLS fit";
 lineparm x = 0 y = 6.8067 slope = 0.0167/curvelabel = "Quantreg for median" lineattrs = (color = "red");
run;

ods layout end;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;but PNG doesn't support gridded output, so there are multiple .png files. How can I create a single PNG file with 4 graphs?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 29 Jun 2019 18:37:34 GMT</pubDate>
    <dc:creator>plf515</dc:creator>
    <dc:date>2019-06-29T18:37:34Z</dc:date>
    <item>
      <title>How can I create a .png file with gridded output?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-can-I-create-a-png-file-with-gridded-output/m-p/570051#M18395</link>
      <description>&lt;P&gt;I am using SAS 9.4 1M6 on a Windows 10 machine.&amp;nbsp; I have a program that creates what I want in HTML:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods listing gpath = "c:\writing\nonfiction\glm book";
ods graphics /imagename = "anscombe1sas" imagefmt = png;
ods layout gridded columns = 2 rows = 2;
ods region;
proc sgplot data = anscombe;
 scatter x = x1 y = y1;
 lineparm x = 0 y = 3.000090909 slope = 0.500090909/curvelabel = "OLS fit";
 lineparm x = 0 y = 3.24 slope = 0.48/curvelabel = "Quantreg for median" lineattrs = (color = "red");
run;

ods region;
proc sgplot data = anscombe;
 scatter x = x1 y = y2;
 lineparm x = 0 y = 3.000909091 slope = 0.5/curvelabel = "OLS fit";
 lineparm x = 0 y = 3.13 slope = 0.5/curvelabel = "Quantreg for median" lineattrs = (color = "red");
run;


ods region;
proc sgplot data = anscombe;
 scatter x = x1 y = y3;
 lineparm x = 0 y = 3.002454545 slope = 0.5/curvelabel = "OLS fit";
 lineparm x = 0 y = 4.01 slope = 0.345/curvelabel = "Quantreg for median" lineattrs = (color = "red");
run;


ods region;
proc sgplot data = anscombe;
 scatter x = x1 y = y4;
 lineparm x = 0 y = 9.231363636 slope = -0.192272727/curvelabel = "OLS fit";
 lineparm x = 0 y = 6.8067 slope = 0.0167/curvelabel = "Quantreg for median" lineattrs = (color = "red");
run;

ods layout end;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;but PNG doesn't support gridded output, so there are multiple .png files. How can I create a single PNG file with 4 graphs?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Jun 2019 18:37:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-can-I-create-a-png-file-with-gridded-output/m-p/570051#M18395</guid>
      <dc:creator>plf515</dc:creator>
      <dc:date>2019-06-29T18:37:34Z</dc:date>
    </item>
    <item>
      <title>Re: How can I create a .png file with gridded output?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-can-I-create-a-png-file-with-gridded-output/m-p/570056#M18396</link>
      <description>&lt;P&gt;You'll need to use GTL instead. A LAYOUT LATTICE gives you the ability to put multiple plots in the same graph. The code below should get you close to what you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope it helps!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template;
define statgraph ScatPlots;
begingraph;
layout lattice / rows=2 columns=2;
layout overlay;
  scatterplot x = x1 y = y1;
  lineparm x = 0 y = 3.000090909 slope = 0.500090909/curvelabel = "OLS fit";
  lineparm x = 0 y = 3.24 slope = 0.48/curvelabel = "Quantreg for median" lineat
trs = (color = red);
endlayout;
layout overlay;
  scatterplot x = x1 y = y2;
  lineparm x = 0 y = 3.000909091 slope = 0.5/curvelabel = "OLS fit";
  lineparm x = 0 y = 3.13 slope = 0.5/curvelabel = "Quantreg for median" lineatt
rs = (color = red);
endlayout;
layout overlay;
  scatterplot x = x1 y = y3;
  lineparm x = 0 y = 3.002454545 slope = 0.5/curvelabel = "OLS fit";
  lineparm x = 0 y = 4.01 slope = 0.345/curvelabel = "Quantreg for median" linea
ttrs = (color = red);
endlayout;
layout overlay;
  scatterplot x = x1 y = y4;
  lineparm x = 0 y = 9.231363636 slope = -0.192272727/curvelabel = "OLS fit";
  lineparm x = 0 y = 6.8067 slope = 0.0167/curvelabel = "Quantreg for median" li
neattrs = (color = red);
endlayout;
endlayout;
endgraph;
end;
run;

proc sgrender data=anscombe template=ScatPlots;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 29 Jun 2019 19:23:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-can-I-create-a-png-file-with-gridded-output/m-p/570056#M18396</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2019-06-29T19:23:31Z</dc:date>
    </item>
  </channel>
</rss>

