<?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: Multiple graphs per page to PDF using sgplot in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-to-PDF-using-sgplot/m-p/581575#M18703</link>
    <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
    <pubDate>Thu, 15 Aug 2019 19:22:23 GMT</pubDate>
    <dc:creator>michokwu</dc:creator>
    <dc:date>2019-08-15T19:22:23Z</dc:date>
    <item>
      <title>Multiple graphs per page to PDF using sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-to-PDF-using-sgplot/m-p/581502#M18698</link>
      <description>&lt;P&gt;Hello experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using proc sgplot to graph and sending my output, which is multiple graphs in one page to PDF, however, when I run the code the graphs are placed vertically instead of horizontally. I am obviously doing something wrong. Please see my code below.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods _all_ close; 
ods pdf file="&amp;amp;path/tasks/stl_conf/conf_new/report9.pdf" style=calibri startpage=never notoc dpi=300;

ods graphics / reset=all height=3in width=4in; 
ods layout gridded columns=2;
proc sgplot data=hist2.pop_by_age1 noautolegend;
styleattrs datacolors=(BIB VLIGB) datacontrastcolors=(gray);
vbarparm category=Age_group response=Delta_Age /group=group groupdisplay=cluster fillpattern
   limitlower=L_Age limitupper=U_Age limitattrs=(color=vipr);
   title 'Change by Age';
   yaxis label='change';
   xaxis label='Age';
run;
proc sgplot data=hist2.age25_above1 noautolegend;
styleattrs datacolors=(BIB VLIGB) datacontrastcolors=(gray);
vbarparm category=educational_attainment response=Delta_25_above / group=group groupdisplay=cluster fillpattern
   limitlower=L_Ed limitupper=U_Ed limitattrs=(color=vipr);
   title "Change by Educational attainment for 25 Years and Above";
   yaxis label='change';
   xaxis label='Level of educational attainment';
run;

ods pdf close;
ods preferences;
ods layout end; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2019 16:48:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-to-PDF-using-sgplot/m-p/581502#M18698</guid>
      <dc:creator>michokwu</dc:creator>
      <dc:date>2019-08-15T16:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple graphs per page to PDF using sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-to-PDF-using-sgplot/m-p/581505#M18699</link>
      <description>&lt;P&gt;Did you try changing your graph sizes.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A page is 8.5x11 and your graphs are 4 inches wide so that is likely causing issues. You also want to move some lines of your code around - layout end should go before ODS PDF CLOSE most likely.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this, instead of layout, use the columns option on ODS PDF statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods _all_ close; 
ods pdf file="&amp;amp;path/tasks/stl_conf/conf_new/report9.pdf" style=calibri startpage=never notoc dpi=300 columns=2;

ods graphics / reset=all height=3in width=4in; 

proc sgplot data=hist2.pop_by_age1 noautolegend;
styleattrs datacolors=(BIB VLIGB) datacontrastcolors=(gray);
vbarparm category=Age_group response=Delta_Age /group=group groupdisplay=cluster fillpattern
   limitlower=L_Age limitupper=U_Age limitattrs=(color=vipr);
   title 'Change by Age';
   yaxis label='change';
   xaxis label='Age';
run;

proc sgplot data=hist2.age25_above1 noautolegend;
styleattrs datacolors=(BIB VLIGB) datacontrastcolors=(gray);
vbarparm category=educational_attainment response=Delta_25_above / group=group groupdisplay=cluster fillpattern
   limitlower=L_Ed limitupper=U_Ed limitattrs=(color=vipr);
   title "Change by Educational attainment for 25 Years and Above";
   yaxis label='change';
   xaxis label='Level of educational attainment';
run;



ods pdf close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you want to stick with layout try changing your graph sizes to see if they go side by side. If they do, I think you need to then adjust your margins to make sense.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/255120"&gt;@michokwu&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello experts,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using proc sgplot to graph and sending my output, which is multiple graphs in one page to PDF, however, when I run the code the graphs are placed vertically instead of horizontally. I am obviously doing something wrong. Please see my code below.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods _all_ close; 
ods pdf file="&amp;amp;path/tasks/stl_conf/conf_new/report9.pdf" style=calibri startpage=never notoc dpi=300;

ods graphics / reset=all height=3in width=4in; 
ods layout gridded columns=2;
proc sgplot data=hist2.pop_by_age1 noautolegend;
styleattrs datacolors=(BIB VLIGB) datacontrastcolors=(gray);
vbarparm category=Age_group response=Delta_Age /group=group groupdisplay=cluster fillpattern
   limitlower=L_Age limitupper=U_Age limitattrs=(color=vipr);
   title 'Change by Age';
   yaxis label='change';
   xaxis label='Age';
run;
proc sgplot data=hist2.age25_above1 noautolegend;
styleattrs datacolors=(BIB VLIGB) datacontrastcolors=(gray);
vbarparm category=educational_attainment response=Delta_25_above / group=group groupdisplay=cluster fillpattern
   limitlower=L_Ed limitupper=U_Ed limitattrs=(color=vipr);
   title "Change by Educational attainment for 25 Years and Above";
   yaxis label='change';
   xaxis label='Level of educational attainment';
run;

ods pdf close;
ods preferences;
ods layout end; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2019 16:58:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-to-PDF-using-sgplot/m-p/581505#M18699</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-08-15T16:58:48Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple graphs per page to PDF using sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-to-PDF-using-sgplot/m-p/581514#M18700</link>
      <description>Hi:&lt;BR /&gt;  Take a look at this paper -- pages 23/24/25:&lt;BR /&gt;&lt;A href="http://support.sas.com/resources/papers/proceedings16/SAS5762-2016.pdf" target="_blank"&gt;http://support.sas.com/resources/papers/proceedings16/SAS5762-2016.pdf&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I think you're missing  column_widths on the ODS LAYOUT statement to set the width of the columns you want the images to go in and I then I think you also need ODS REGION; statements to indicate to ODS when to move to a new region. The code model for the output is in the paper -- my output had a PROC REPORT at the top but you can ignore that part. The only other thing I would recommend is that you make sure your margins are set appropriately with a width of 4 in for each image, you're almost running out of space on a portrait page. I'd tend to do 3.75 for the column widths and 3.5 for the image widths with .25 left and right margins, should look good in 8 inches on a portrait page.&lt;BR /&gt;Hope this helps,&lt;BR /&gt;Cynthia</description>
      <pubDate>Thu, 15 Aug 2019 17:08:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-to-PDF-using-sgplot/m-p/581514#M18700</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-08-15T17:08:57Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple graphs per page to PDF using sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-to-PDF-using-sgplot/m-p/581574#M18702</link>
      <description>&lt;P&gt;Thanks for the feedback. Cynthia's option worked.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2019 19:22:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-to-PDF-using-sgplot/m-p/581574#M18702</guid>
      <dc:creator>michokwu</dc:creator>
      <dc:date>2019-08-15T19:22:07Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple graphs per page to PDF using sgplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-to-PDF-using-sgplot/m-p/581575#M18703</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2019 19:22:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-to-PDF-using-sgplot/m-p/581575#M18703</guid>
      <dc:creator>michokwu</dc:creator>
      <dc:date>2019-08-15T19:22:23Z</dc:date>
    </item>
  </channel>
</rss>

