<?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 in PNG file in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-in-PNG-file/m-p/578976#M18633</link>
    <description>&lt;P&gt;Do you have any example that use both lattice and Dynamics?&lt;/P&gt;</description>
    <pubDate>Sun, 04 Aug 2019 08:30:06 GMT</pubDate>
    <dc:creator>SanjayAhir</dc:creator>
    <dc:date>2019-08-04T08:30:06Z</dc:date>
    <item>
      <title>Multiple graphs per page in PNG file</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-in-PNG-file/m-p/578653#M18608</link>
      <description>&lt;P&gt;I want graph per page in PNG file. I have tried many ways but didn't get. I am using below code but from this code i am getting 2 separate output instead of two graph in one PNG file (One per page).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let __date = %sysfunc(putn( %sysfunc(date()) ,date9.));&lt;BR /&gt;%put &amp;amp;__date. ;&lt;/P&gt;
&lt;P&gt;%LET outputno = 1 ;&lt;BR /&gt;%inc gtitles;&lt;BR /&gt;ods listing image_dpi=300 gpath="&amp;amp;mrgpath";&lt;BR /&gt;options nobyline;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;ods graphics on / reset=index imagename="&amp;amp;mrimgnm" imagefmt=png width=3.5in height=3in byline=title&lt;BR /&gt;border=off antialiasmax=10000;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro temp(lb=,mn=,mx=,grp=);&lt;/P&gt;
&lt;P&gt;proc template;&lt;BR /&gt;define statgraph example3_template_v2;&lt;BR /&gt;dynamic _title1 _title2 _footnotel _footnoter _disp;&lt;BR /&gt;begingraph ;*/designwidth=1000px designheight=1000px;&lt;BR /&gt;entrytitle halign=left textattrs=(size=5pt weight=normal) "ABC";&lt;BR /&gt;entryfootnote halign=left textattrs=(size=5pt) "XYZ";&lt;BR /&gt;entryfootnote halign=right textattrs=(size=5pt) "&amp;amp;progname &amp;amp;SYSDATE9";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;layout lattice/ columns=1 rows=1 rowgutter=0pt columnweights=(0.300) &lt;BR /&gt;columngutter=0 rowdatarange=union;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;layout overlay /WALLDISPLAY=NONE&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;yaxisopts=(label="Maximum decrease from baseline [%]" labelattrs=(size=5)&lt;BR /&gt;labelfitpolicy=split tickvalueattrs=(size=5pt)&lt;BR /&gt;linearopts=(viewmin=-100 viewmax=80 tickvaluesequence = (start=-100 end=80 increment=20)))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;xaxisopts=(label="Patient index sorted by maximum % decrease" labelattrs=(size=5)&lt;BR /&gt;discreteopts=(tickvaluefitpolicy=ROTATE tickdisplaylist=(&amp;amp;&amp;amp;subj&amp;amp;grp)&lt;BR /&gt;tickvaluelist=(&amp;amp;&amp;amp;n&amp;amp;grp)) labelfitpolicy=split &lt;BR /&gt;tickvalueattrs=(size=1pt) linearopts=(viewmin=&amp;amp;mn viewmax=&amp;amp;mx));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;barchartparm x=eval(ifn(trtpn=&amp;amp;grp,input(n,8.),.)) y=eval(ifn(trtpn=&amp;amp;grp,pchg,.)) / orient=vertical &lt;BR /&gt;group=pchgcat1 BARWIDTH=1 name="A";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;discretelegend "A"/valueattrs=(size=1pt) halign=right valign=top border=false;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;referenceline y=20 /LINEATTRS=(color=black thickness=1 pattern=shortdash);&lt;BR /&gt;referenceline y=-30/LINEATTRS=(color=black thickness=1 pattern=shortdash);&lt;BR /&gt;referenceline y=-50/LINEATTRS=(color=black thickness=1 pattern=shortdash);&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;endlayout;&lt;BR /&gt;endlayout;&lt;BR /&gt;endgraph;&lt;BR /&gt;end;&lt;BR /&gt;run; &lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sgrender data=adtr1 template = example3_template_v2;&lt;BR /&gt;dynamic &lt;BR /&gt;_disp = "all"&lt;BR /&gt;_title1 = "&amp;amp;mrds2 &amp;amp;mrdx"&lt;BR /&gt;_title2 = "&amp;amp;mrds2"&lt;BR /&gt;_footnotel = "&amp;amp;mrsrc"&lt;BR /&gt;_footnoter = "%trim(&amp;amp;progname) &amp;amp;__date";&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;%mend;&lt;BR /&gt;%temp(lb=TRT1,mn=&amp;amp;ord0,mx=&amp;amp;ord1,grp=8);&lt;/P&gt;
&lt;P&gt;%temp(lb=TRT2,mn=&amp;amp;ord2,mx=&amp;amp;ord3,grp=9);&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2019 12:33:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-in-PNG-file/m-p/578653#M18608</guid>
      <dc:creator>SanjayAhir</dc:creator>
      <dc:date>2019-08-02T12:33:33Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple graphs per page in PNG file</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-in-PNG-file/m-p/578686#M18609</link>
      <description>&lt;P&gt;Can you describe what you want the final result to look like? It looks like your template defines a vertical bar chart and then renders it by using PROC SGRENDER.&amp;nbsp; Thus each call to your macro will produce one graph.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want a panel of graphs, you can use PROC SGPANEL if the data are in "long form." You can also define template that uses LAYOUT LATTICE / COLUMNS=2;&lt;/P&gt;
&lt;P&gt;to create a panel.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2019 13:10:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-in-PNG-file/m-p/578686#M18609</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2019-08-02T13:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple graphs per page in PNG file</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-in-PNG-file/m-p/578690#M18610</link>
      <description>&lt;P&gt;Final result I want is 2 graph but it will be in two pages like each graph per page. If i use panel procedure than both the graph will come in one page that i dont want. I want both graph in separate page in PNG file.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2019 13:16:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-in-PNG-file/m-p/578690#M18610</guid>
      <dc:creator>SanjayAhir</dc:creator>
      <dc:date>2019-08-02T13:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple graphs per page in PNG file</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-in-PNG-file/m-p/578716#M18612</link>
      <description>&lt;P&gt;In this case, your best option is to do what&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;suggested and use a LAYOUT LATTICE with COLUMNS=2 in your template. This means you will will need to pass the dynamics for both plots using one call of your macro.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2019 14:32:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-in-PNG-file/m-p/578716#M18612</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2019-08-02T14:32:14Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple graphs per page in PNG file</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-in-PNG-file/m-p/578728#M18613</link>
      <description>I don't believe PNG files have the concept of 'pages', it's just a graphic format. Do you mean two different PNG files?</description>
      <pubDate>Fri, 02 Aug 2019 14:50:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-in-PNG-file/m-p/578728#M18613</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-08-02T14:50:51Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple graphs per page in PNG file</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-in-PNG-file/m-p/578976#M18633</link>
      <description>&lt;P&gt;Do you have any example that use both lattice and Dynamics?&lt;/P&gt;</description>
      <pubDate>Sun, 04 Aug 2019 08:30:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-in-PNG-file/m-p/578976#M18633</guid>
      <dc:creator>SanjayAhir</dc:creator>
      <dc:date>2019-08-04T08:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple graphs per page in PNG file</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-in-PNG-file/m-p/578977#M18634</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Not two different png. One graph per page I want&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Aug 2019 08:31:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-in-PNG-file/m-p/578977#M18634</guid>
      <dc:creator>SanjayAhir</dc:creator>
      <dc:date>2019-08-04T08:31:04Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple graphs per page in PNG file</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-in-PNG-file/m-p/579028#M18636</link>
      <description>Can you show me an example of what that file may look like? Any images in two pages in a PNG file would help. I still don't think PNG's have the concept of pages, it's a single image file type. It's part of why PNG's cannot be animated, but there is a modified format that can hold two pages, MNG.</description>
      <pubDate>Sun, 04 Aug 2019 17:50:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-in-PNG-file/m-p/579028#M18636</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-08-04T17:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple graphs per page in PNG file</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-in-PNG-file/m-p/579054#M18637</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt; Not two different png. One graph per page I want&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;From &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;:&amp;nbsp; I don't believe PNG files have the concept of 'pages'&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/24078"&gt;@SanjayAhir&lt;/a&gt;&amp;nbsp; Can you see why you haven't&amp;nbsp;explained your needs properly?&amp;nbsp; There are no pages in PNG files.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2019 01:53:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-in-PNG-file/m-p/579054#M18637</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2019-08-05T01:53:13Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple graphs per page in PNG file</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-in-PNG-file/m-p/579068#M18638</link>
      <description>&lt;P&gt;I have attached file for reference. I want two graph like mentioned in attachment with enough space between two graph&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Graph.png" style="width: 587px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/31526iBFCDAF1C4CE40A7F/image-size/large?v=v2&amp;amp;px=999" role="button" title="Graph.png" alt="Graph.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2019 05:12:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-in-PNG-file/m-p/579068#M18638</guid>
      <dc:creator>SanjayAhir</dc:creator>
      <dc:date>2019-08-05T05:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple graphs per page in PNG file</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-in-PNG-file/m-p/579209#M18641</link>
      <description>&lt;P&gt;You can do that within a single PROC, not quite sure how you'd macrotize this, unless you do it for each layout statement. In that case you may want to look into the DATALATTICE statement which can make it data driven.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Set the # of rows to 2, which is one for each graph as well as specifying the ROWGUTTER setting to 1 inch, which adds the spacing between the graphs. This will create a single PNG file.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc template;
  define statgraph lattice;
  begingraph;
    entrytitle "Car Performance Profile";
    layout lattice / border=true pad=10 opaque=true
                     &lt;FONT size="5" color="#FF6600"&gt;&lt;STRONG&gt;rows=2 columns=1 columngutter=3 rowgutter=1IN;&lt;/STRONG&gt;&lt;/FONT&gt;
      layout overlay;
        scatterplot x=horsepower y=mpg_city /
          group=origin name="cars";
        regressionPlot x=horsepower y=mpg_city / degree=2;
      endlayout;
      
      layout overlay;
      
      
      
      endlayout;

      layout overlay;
         barchart category=type  response=mpg_highway /
          stat=mean orient=horizontal;
      endlayout;
     
    endlayout;
  endgraph;
  end;
run;

ods html file = '/folders/myfolders/demo.html' gpath = '/folders/myfolders/Temp/';
ods graphics on / imagefmt= png imagename="carGraph";

proc sgrender template=lattice data=sashelp.cars;
run;

ods graphics off;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="carGraph.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/31539iA4CBEAF3F2FD18F7/image-size/large?v=v2&amp;amp;px=999" role="button" title="carGraph.png" alt="carGraph.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2019 18:38:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-in-PNG-file/m-p/579209#M18641</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2019-08-05T18:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: Multiple graphs per page in PNG file</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-in-PNG-file/m-p/580770#M18679</link>
      <description>&lt;P&gt;Here's one way to do it, using SAS/Graph Proc Greplay:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data my_data; set sashelp.stocks (where=(date&amp;gt;='01jan2005'd));&lt;BR /&gt;format date monname3.;&lt;BR /&gt;quarter=put(date,yyq.);&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;axis1 label=none;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;goptions nodisplay;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;goptions xpixels=500 ypixels=400;&lt;BR /&gt;title ls=3.0 "IBM Graph";&lt;BR /&gt;footnote h=5pct " ";&lt;BR /&gt;proc gchart data=my_data (where=(stock='IBM'));&lt;BR /&gt;vbar date / discrete type=sum sumvar=close subgroup=quarter &lt;BR /&gt;maxis=axis1 raxis=axis1 name='graph1';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;goptions xpixels=500 ypixels=400;&lt;BR /&gt;title ls=3.0 "Intel Graph";&lt;BR /&gt;footnote h=5pct " ";&lt;BR /&gt;proc gchart data=my_data (where=(stock='Intel'));&lt;BR /&gt;vbar date / discrete type=sum sumvar=close subgroup=quarter &lt;BR /&gt;maxis=axis1 raxis=axis1 name='graph2';&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;goptions display;&lt;BR /&gt;goptions xpixels=500 ypixels=800;&lt;BR /&gt;proc greplay igout=work.gseg tc=sashelp.templt template=v2s nofs;&lt;BR /&gt;treplay 1:graph1 2:graph2;&lt;BR /&gt;run;&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="template.png" style="width: 375px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/31697iF1C7688A819F010F/image-size/large?v=v2&amp;amp;px=999" role="button" title="template.png" alt="template.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Aug 2019 12:19:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Multiple-graphs-per-page-in-PNG-file/m-p/580770#M18679</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2019-08-13T12:19:08Z</dc:date>
    </item>
  </channel>
</rss>

