<?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: PROC template Graph in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745676#M21628</link>
    <description>Unfortunately that's beyond my skill set or time at the moment. Hopefully someone else can help you out. If I were to try and do this, I'd start by using the TMPLOUT option from SGPLOT to get the code for each graph and then figure out how to wrap the PROC TEMPLATE code around it for the layout.</description>
    <pubDate>Fri, 04 Jun 2021 03:39:58 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2021-06-04T03:39:58Z</dc:date>
    <item>
      <title>PROC template Graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745255#M21611</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Adeoye_0-1622655259359.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/59974i459C449708519028/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Adeoye_0-1622655259359.png" alt="Adeoye_0-1622655259359.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have attached the data if it would be useful in your helping me achieve this task.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data Selected; 
	Set mylibrary.Mean_Comparison_Proc;
	Period2 = input(Period, 2.);
	Drop Period;
	rename Period2=Period;
run;
Proc Sort Data=Selected;
	by resp_name Treatment Period;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I created the above individual graphs using SGPLOT within a macro, with the below code:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Proc Sql noprint;
	select count(distinct resp_name) into :obs from Selected;
	select distinct resp_name into :resp1-:resp5 from Selected;
Quit;

%Macro TestSee;
	%do i = 1 %to &amp;amp;obs;
		%Let value1=(650 to 750 by 10); %Let value2=(1.0 to 2.0 by 0.1); %Let value3=(1 to 2.0 by 0.1); %Let value4=(2 to 5 by 0.1); %Let value5=(35 to 45 by 1);
		%Let ylabel1=BW, kg; %Let ylabel2=ECM/DMI, kg/kg; %Let ylabel3=Milk Fat Yield, kg; %Let ylabel4=Milk Fat Percentage, %; %Let ylabel5=Milk Yield, kg;
		%Let xlabel=Week of Trial;
		proc format;
		value $treatmentFmt
		"Bov" = "PRO-A"
		"BovC" = "PRO-B"
		"Control" = "CON" 
		;
		ods html style=listing; *In SAS 9.4 you need a style like LISTING to see different symbols;
		Proc SGPLOT data = Selected noautolegend;
			format treatment $treatmentFmt.;
			where resp_name="&amp;amp;&amp;amp;resp&amp;amp;i";
			styleattrs datasymbols=(CircleFilled triangleFilled SquareFilled) datalinepatterns=(ShortDash Solid MediumDash) datacontrastcolors=(darkblue darkred darkgreen); 
			Series x=Period y=estimate/ group=Treatment grouplc=Treatment groupmc=Treatment markers lineattrs=(thickness=1) name="Treatment";
			Scatter x=Period y=estimate/ group=Treatment name="a" YErrorUpper=Upper YErrorLower=Lower;*groupdisplay=cluster clusterwidth=0.6 datalabel=MSgroup datalabelattrs=(size=9pt color=gray);
			yaxis label="&amp;amp;&amp;amp;ylabel&amp;amp;i" Labelattrs=(Family=Arial Size=11 weight=Bold ) valueattrs=(size=10) values=&amp;amp;&amp;amp;value&amp;amp;i;
			xaxis discreteorder=data label="&amp;amp;xlabel." Labelattrs=(Family=Arial Size=11 weight=Bold ) valueattrs=(size=10) values=(1 to 12 by 1);
			keylegend "Treatment"/ title="Treatment:" location=inside position=topright across=1;
		run;
 	%end;
		Ods html CLOSE;
 %mend;
%TestSee;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;What i however need is a grid of all 5 graphs with independent axis, all labelled as i did with the above graph. I did research on Proc template and it seems it could really do the job for me, but i still couldn't figure out how to make this work. I will really appreciate your help guys. Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Jun 2021 15:27:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745255#M21611</guid>
      <dc:creator>Adeoye</dc:creator>
      <dc:date>2021-06-03T15:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: PROC template Graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745271#M21612</link>
      <description>&lt;P&gt;Please, if there is any clarification you need me to provide in order to assist me with the above problem, i will be glad to provide it. I can do this with SGPANEL, but i do not want to use sgpanel since i won't be having independent axis scales and labels for all graphs. Thank you&lt;/P&gt;&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt;,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/27741"&gt;@gcjfernandez&lt;/a&gt;,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/16961"&gt;@ChrisNZ&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15130"&gt;@DanH_sas&lt;/a&gt;,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4"&gt;@ChrisHemedinger&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/46600"&gt;@RickStyll_SAS&lt;/a&gt;,&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/19750"&gt;@MichelleHomes&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13585"&gt;@GraphGuy&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jun 2021 18:53:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745271#M21612</guid>
      <dc:creator>Adeoye</dc:creator>
      <dc:date>2021-06-02T18:53:22Z</dc:date>
    </item>
    <item>
      <title>Re: PROC template Graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745277#M21613</link>
      <description>&lt;P&gt;When you say a 'grid' - are you wanting all 5 graphs on one page (such as in 1 png file)?&lt;/P&gt;
&lt;P&gt;Do you want the grid 1-across, and 5-down?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jun 2021 18:48:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745277#M21613</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2021-06-02T18:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: PROC template Graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745279#M21614</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13585"&gt;@GraphGuy&lt;/a&gt;&amp;nbsp;Thanks for the response. Yes, i want all 5 graphs in one page. I want 2 columns and 2 rows, but since its odd number of graphs this will imply one of the columns will have 3 graphs.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jun 2021 18:51:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745279#M21614</guid>
      <dc:creator>Adeoye</dc:creator>
      <dc:date>2021-06-02T18:51:19Z</dc:date>
    </item>
    <item>
      <title>Re: PROC template Graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745291#M21615</link>
      <description>Is your final destination HTML or do you want PDF? If you're using PDF it has a column option to pipe the output to different columns automatically as long you specify the graph sizes to fit appropriately. &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 02 Jun 2021 19:10:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745291#M21615</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-06-02T19:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: PROC template Graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745295#M21616</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;The final destination is PDF. I will appreciate an example of how to execute what you described. Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jun 2021 19:22:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745295#M21616</guid>
      <dc:creator>Adeoye</dc:creator>
      <dc:date>2021-06-02T19:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: PROC template Graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745298#M21617</link>
      <description>&lt;P&gt;Here you go. You do need to specify the sizes to control the size of the graphs and how they fit on the page. In this case, I've set them all the same, but you can vary them as needed as well with separate ODS GRAPHICS statements.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods pdf file='/home/fkhurshed/demo.pdf' columns=2 startpage=never;

ods graphics / width = 2.75in height = 3in;

proc sgplot data=sashelp.class;
scatter x=weight y=height;
run;

proc sgplot data=sashelp.class;
scatter x=age y=height;
run;

proc sgplot data=sashelp.cars;
scatter x=mpg_city y=mpg_highway;
run;

proc sgplot data=sashelp.stocks;
where stock = "IBM";
series x=date y=high;
run;

proc sgplot data=sashelp.class;
vbar age;
run;

ods pdf close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jun 2021 19:32:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745298#M21617</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-06-02T19:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: PROC template Graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745337#M21622</link>
      <description>&lt;P&gt;Thank you so much&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13879"&gt;@Reeza&lt;/a&gt;&amp;nbsp;. Your solution was very helpful. Below is the output graph.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Adeoye_0-1622668731242.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/59983i737291D40E900DA9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Adeoye_0-1622668731242.png" alt="Adeoye_0-1622668731242.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Is there a way i can add number to each of these graphs (e.g. A. B. C. D. or 1. 2. 3. 4.)? So i can reference each graph and describe them in the footnote i will be adding.&lt;/P&gt;&lt;P&gt;My second question is not so important, but i noticed that each graph in the grid are separate images in the output pdf, and i cannot copy them all as a single image. Do you have a solution that could help me with this? I can simply take a screenshot, but this will reduce image quality, so your suggested solution will be immensely appreciated.&amp;nbsp; Thank you once again. Much gratitude.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jun 2021 21:29:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745337#M21622</guid>
      <dc:creator>Adeoye</dc:creator>
      <dc:date>2021-06-02T21:29:05Z</dc:date>
    </item>
    <item>
      <title>Re: PROC template Graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745350#M21625</link>
      <description>Never mind about the first question. I did the graph numbering using title and justified left. I will really appreciate some insight into how i could make this into a single image though. Thank you.</description>
      <pubDate>Wed, 02 Jun 2021 22:27:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745350#M21625</guid>
      <dc:creator>Adeoye</dc:creator>
      <dc:date>2021-06-02T22:27:52Z</dc:date>
    </item>
    <item>
      <title>Re: PROC template Graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745537#M21626</link>
      <description>I'm not sure this solution would generate a single image, it generates multiple. I think if you want a single image, PNG would be a better format and then you need PROC TEMPLATE.</description>
      <pubDate>Thu, 03 Jun 2021 16:33:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745537#M21626</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-06-03T16:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: PROC template Graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745669#M21627</link>
      <description>&lt;P&gt;Hello&amp;nbsp;Reeza, please would you mind helping me with a PROC TEMPLATE draft for the code i shared. I'm hoping to have the graphs layout as they were in the last image i shared. Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jun 2021 02:30:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745669#M21627</guid>
      <dc:creator>Adeoye</dc:creator>
      <dc:date>2021-06-04T02:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: PROC template Graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745676#M21628</link>
      <description>Unfortunately that's beyond my skill set or time at the moment. Hopefully someone else can help you out. If I were to try and do this, I'd start by using the TMPLOUT option from SGPLOT to get the code for each graph and then figure out how to wrap the PROC TEMPLATE code around it for the layout.</description>
      <pubDate>Fri, 04 Jun 2021 03:39:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745676#M21628</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-06-04T03:39:58Z</dc:date>
    </item>
    <item>
      <title>Re: PROC template Graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745684#M21629</link>
      <description>&lt;P&gt;Use proc TEMPLATE define STATGRAPH statement.&amp;nbsp; Use the LAYOUT GRIDDED structure to layout your graphs in a 2 column layout.&amp;nbsp; You have to define each graph using separate 4 or 5 Layout Overlay blocks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See example:&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatgraph/p1h7wd5z8ihewzn1vy7htk5tu7nr.htm#n0i4e8zlkvabzsn11wy9kh254ejz" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatgraph/p1h7wd5z8ihewzn1vy7htk5tu7nr.htm#n0i4e8zlkvabzsn11wy9kh254ejz&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jun 2021 04:44:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745684#M21629</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2021-06-04T04:44:21Z</dc:date>
    </item>
    <item>
      <title>Re: PROC template Graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745698#M21630</link>
      <description>&lt;P&gt;I don't have your data and I don't currently have access to SAS (I can look tomorrow) so I am writing this freeform, but the GTL code would look something like the following.&amp;nbsp; The code makes the template (the ODS PATH statement is to save the template to your WORK directory) and sets up a 3 x 2 lattice.&amp;nbsp; Each cell of the lattice must be filled with an LAYOUT OVERLAY block which is essentially a graph space (new X/Y axis).&amp;nbsp; I changed your loop so that it would add the overlay blocks with the macro loop and updated the graph code to be more in line with GTL (it's slightly different than SGPLOT coding syntax).&amp;nbsp; There's no STYLEATTRS statement in GTL so I made a discrete attribute map block instead to do the same thing based on the data I can see in your graphs.&amp;nbsp; This is basically a style format for the different values in your data.&amp;nbsp; I think this corresponds to the formatted values, but could be wrong.&amp;nbsp; the EVAL functions are working to subset each block similar to your WHERE statements you had.&amp;nbsp; The CELL block is where each cell's title can go.&amp;nbsp; In the end the graph is created with the SGRENDER procedure pointing at your data and at the template that was just made.&amp;nbsp; The actual TEMPLATE code doesn't make anything without the SGRENDER.&amp;nbsp; Again, apologies if there's any errors as I can't test it right now.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%Macro TestSee;
	proc format;
		value $treatmentFmt
		"Bov" = "PRO-A"
		"BovC" = "PRO-B"
		"Control" = "CON" 
		;
        run;
     
     ODS PATH work.templat(update) sasuser.templat(read) sashelp.tmplmst(read);
     PROC TEMPLATE;
        DEFINE STATGRAPH _grid;
        BEGINGRAPH / designheight=10in designwidth=8in;
        
	%Let value1=start=650 end=750 increment=10; 
        %Let value2=start=1.0 end=2.0 increment=0.1; 
        %Let value3=start=1 end=2.0 increment=0.1; 
        %Let value4=start=2 end=5 increment=0.1; 
        %Let value5=start=35 end=45 increment=1;
	%Let ylabel1=BW, kg; %Let ylabel2=ECM/DMI, kg/kg; %Let ylabel3=Milk Fat Yield, kg; %Let ylabel4=Milk Fat Percentage, %; %Let ylabel5=Milk Yield, kg;
	%Let xlabel=Week of Trial;

        DISCRETEATTRMAP name='styles' / ignorecase=true;
             value 'PRO-A' / markerattrs=(symbol=circlefilled color=darkblue) lineattrs=(pattern=shortdash color=darkblue);
             value 'PRO-B' / markerattrs=(symbol=trianglefilled color=darkred) lineattrs=(pattern=solid color=darkred);
             value 'CON' / markerattrs=(symbol=squarefilled color=darkgreen) lineattrs=(pattern=mediumdash color=darkgreen);
        ENDDISCRETEATTRMAP;
        DISCRETEATTRVAR attrvar=_attrvar_ var=treatment attrmap='styles';

        LAYOUT LATTICE / rows=3 columns=2;**Use ORDER=ROWMAJOR or COLUMNMAJOR to determine if the graphs fill top to bottom or left to right;
	%do i = 1 %to &amp;amp;obs;&lt;BR /&gt;        CELL;&lt;BR /&gt;          CELLHEADER; &lt;BR /&gt;                ENTRY halign=left 'This is where a title goes';&lt;BR /&gt;          ENDCELLHEADER;
		LAYOUT OVERLAY / xaxisopts=(type=linear label="&amp;amp;xlabel." linearopts=(tickvaluesequence=(start=1 end=12 increment=1))
                                            Labelattrs=(Family='Arial' Size=11 weight=Bold ) tickvalueattrs=(size=10))
                                 yaxisopts=(label="&amp;amp;&amp;amp;ylabel&amp;amp;i" Labelattrs=(Family='Arial' Size=11 weight=Bold ) tickvalueattrs=(size=10) 
                                            type=linear linearopts=(tickvaluesequence=(&amp;amp;&amp;amp;value&amp;amp;i)));		
			Seriesplot x=eval(ifn(resp_name="&amp;amp;&amp;amp;resp&amp;amp;i",Period,.)) y=estimate/ group=_attrvar_ display=all lineattrs=(thickness=1) name="Treatment&amp;amp;i";
			Scatterplot x=eval(ifn(resp_name="&amp;amp;&amp;amp;resp&amp;amp;i",Period,.)) y=estimate/ group=_attrvar_ name="a&amp;amp;i" YErrorUpper=Upper YErrorLower=Lower;
			discretelegend "Treatment&amp;amp;i"/ title="Treatment:" location=inside autoalign=(topright) across=1;
		ENDLAYOUT; &lt;BR /&gt;        ENDCELL;
 	%end;
        ENDLAYOUT;
        ENDGRAPH;
        END;
     RUN;

     Proc SGRENDER data = Selected template=_grid;
	format treatment $treatmentFmt.;
     RUN;       
 %mend;
%TestSee;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Jun 2021 14:09:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745698#M21630</guid>
      <dc:creator>JeffMeyers</dc:creator>
      <dc:date>2021-06-04T14:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: PROC template Graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745885#M21632</link>
      <description>&lt;P&gt;&lt;FONT face="times new roman,times" size="4"&gt;Hello Jeff,&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times" size="4"&gt;You rock sir. This is exactly what i wanted. Thank you so much. Wish i could give you &lt;STRONG&gt;a million LIKES &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/STRONG&gt;. There are some flaws i was hoping you could help me address though. The Y-axis range are not working correctly, and the tick values are not displaying correctly. Also, is it possible to position the Y-axis labels a little closer to the axis they are actually depicting. I added the output graph so you could see the result i got. THANK YOU JEFF MEYERS.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Adeoye_3-1622833015932.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60037iC63F7C634E386ED9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Adeoye_3-1622833015932.png" alt="Adeoye_3-1622833015932.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jun 2021 19:02:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745885#M21632</guid>
      <dc:creator>Adeoye</dc:creator>
      <dc:date>2021-06-04T19:02:05Z</dc:date>
    </item>
    <item>
      <title>Re: PROC template Graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745888#M21633</link>
      <description>&lt;P&gt;Ah yes, I forgot to put the VIEWMIN and VIEWMAX values in for the y-axis. I've added several macro variables for min/max values to use in the VIEWMIN/VIEWMAX options below.&amp;nbsp; There are more streamlined ways to do this but I'm making it more verbose to read easier to what I'm doing.&amp;nbsp; Look for the VIEWMIN and VIEWMAX options below as this sets what is visible in the axis. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for the ylabel being spaced a bit.&amp;nbsp; This is because it doesn't exist in the same space as the y-axis tick marks.&amp;nbsp; The wider the tickmarks are the further the y-axis label will be.&amp;nbsp; It won't look as bad when there are actual tick values showing up appropriately, but the only real way to make it closer is to use annotation which is another animal.&amp;nbsp; I can explain how to do that if needed, but try the changes below to see if that helps at all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is some updated code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
%Macro TestSee;
	proc format;
		value $treatmentFmt
		"Bov" = "PRO-A"
		"BovC" = "PRO-B"
		"Control" = "CON" 
		;
        run;
     
     ODS PATH work.templat(update) sasuser.templat(read) sashelp.tmplmst(read);
     PROC TEMPLATE;
        DEFINE STATGRAPH _grid;
        BEGINGRAPH / designheight=10in designwidth=8in;
        
	%Let value1=start=650 end=750 increment=10; %let min1=650; %let max1=750;&lt;BR /&gt;%Let value2=start=1.0 end=2.0 increment=0.1; %let min2=1; %let max2=2;&lt;BR /&gt;%Let value3=start=1 end=2.0 increment=0.1; %let min3=1; %let max3=2;&lt;BR /&gt;%Let value4=start=2 end=5 increment=0.1; %let min4=2; %let max4=5;&lt;BR /&gt;%Let value5=start=35 end=45 increment=1; %let min5=35; %let max5=45;
	%Let ylabel1=BW, kg; %Let ylabel2=ECM/DMI, kg/kg; %Let ylabel3=Milk Fat Yield, kg; %Let ylabel4=Milk Fat Percentage, %; %Let ylabel5=Milk Yield, kg;
	%Let xlabel=Week of Trial;

        DISCRETEATTRMAP name='styles' / ignorecase=true;
             value 'PRO-A' / markerattrs=(symbol=circlefilled color=darkblue) lineattrs=(pattern=shortdash color=darkblue);
             value 'PRO-B' / markerattrs=(symbol=trianglefilled color=darkred) lineattrs=(pattern=solid color=darkred);
             value 'CON' / markerattrs=(symbol=squarefilled color=darkgreen) lineattrs=(pattern=mediumdash color=darkgreen);
        ENDDISCRETEATTRMAP;
        DISCRETEATTRVAR attrvar=_attrvar_ var=treatment attrmap='styles';

        LAYOUT LATTICE / rows=3 columns=2;**Use ORDER=ROWMAJOR or COLUMNMAJOR to determine if the graphs fill top to bottom or left to right;
	%do i = 1 %to &amp;amp;obs;        CELL;          CELLHEADER;                 ENTRY halign=left 'This is where a title goes';          ENDCELLHEADER;
		LAYOUT OVERLAY / xaxisopts=(type=linear label="&amp;amp;xlabel." linearopts=(tickvaluesequence=(start=1 end=12 increment=1) viewmin=1 viewmax=12)
                                            Labelattrs=(Family='Arial' Size=11 weight=Bold ) tickvalueattrs=(size=10))
                                 yaxisopts=(label="&amp;amp;&amp;amp;ylabel&amp;amp;i" Labelattrs=(Family='Arial' Size=11 weight=Bold ) tickvalueattrs=(size=10) 
                                            type=linear linearopts=(tickvaluesequence=(&amp;amp;&amp;amp;value&amp;amp;i) viewmin=&amp;amp;&amp;amp;min&amp;amp;i viewmax=&amp;amp;&amp;amp;max&amp;amp;i));		
			Seriesplot x=eval(ifn(resp_name="&amp;amp;&amp;amp;resp&amp;amp;i",Period,.)) y=estimate/ group=_attrvar_ display=all lineattrs=(thickness=1) name="Treatment&amp;amp;i";
			Scatterplot x=eval(ifn(resp_name="&amp;amp;&amp;amp;resp&amp;amp;i",Period,.)) y=estimate/ group=_attrvar_ name="a&amp;amp;i" YErrorUpper=Upper YErrorLower=Lower;
			discretelegend "Treatment&amp;amp;i"/ title="Treatment:" location=inside autoalign=(topright) across=1;
		ENDLAYOUT;         ENDCELL;
 	%end;
        ENDLAYOUT;
        ENDGRAPH;
        END;
     RUN;

     Proc SGRENDER data = Selected template=_grid;
	format treatment $treatmentFmt.;
     RUN;       
 %mend;
%TestSee;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Jun 2021 19:28:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745888#M21633</guid>
      <dc:creator>JeffMeyers</dc:creator>
      <dc:date>2021-06-04T19:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: PROC template Graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745894#M21634</link>
      <description>&lt;P&gt;&lt;FONT face="times new roman,times" size="4"&gt;Hi Jeff Meyers, &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times" size="4"&gt;Don't you need a certificate to be this awesome?!&amp;nbsp;&lt;/FONT&gt;&lt;span class="lia-unicode-emoji" title=":beaming_face_with_smiling_eyes:"&gt;😁&lt;/span&gt;&lt;FONT face="times new roman,times" size="4"&gt;&amp;nbsp;The viewmin and viewmax totally fixed the problem. You just made my day sir&amp;nbsp;&lt;/FONT&gt;&lt;span class="lia-unicode-emoji" title=":smiling_face_with_heart_eyes:"&gt;😍&lt;/span&gt;&lt;FONT face="times new roman,times" size="4"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times" size="4"&gt;&lt;STRONG&gt;THANK YOU!&amp;nbsp;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="times new roman,times" size="4"&gt;And again, a million &lt;STRONG&gt;LIKES&lt;/STRONG&gt; for you&amp;nbsp;&lt;/FONT&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;FONT face="times new roman,times" size="4"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;FONT face="times new roman,times" size="4"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;FONT face="times new roman,times" size="4"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;FONT face="times new roman,times" size="4"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;FONT face="times new roman,times" size="4"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;FONT face="times new roman,times" size="4"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;FONT face="times new roman,times" size="4"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;FONT face="times new roman,times" size="4"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;FONT face="times new roman,times" size="4"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;FONT face="times new roman,times" size="4"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;FONT face="times new roman,times" size="4"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;FONT face="times new roman,times" size="4"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Adeoye_1-1622835902844.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60040i092BC1F196608556/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Adeoye_1-1622835902844.png" alt="Adeoye_1-1622835902844.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jun 2021 19:49:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745894#M21634</guid>
      <dc:creator>Adeoye</dc:creator>
      <dc:date>2021-06-04T19:49:38Z</dc:date>
    </item>
    <item>
      <title>Re: PROC template Graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745897#M21635</link>
      <description>Glad it worked for you.  One last tip looking at the data.  For the DISCRETELEGEND statement it's possible to put it into the bottom right blank space if you wanted to, but if you'd prefer them to be each of the graph cells you can add more spots to the  ( ) after AUTOALIGN.  For example you can set AUTOALIGN=(TOPRIGHT BOTTOMLEFT) and it'll pick which spot has the least collision with the graph automatically.  If you want to add the legend to the bottom right space I believe you just cut the DISCRETELEGEND statement out of the current spot and paste it after the %do loop ends.  Just change the name in the quotes to be treatment1 instead of treatment&amp;amp;i and it'll reference the legend in the top left cell.  You might have to wrap it with a LAYOUT OVERLAY block, but I'm not positive.</description>
      <pubDate>Fri, 04 Jun 2021 19:55:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745897#M21635</guid>
      <dc:creator>JeffMeyers</dc:creator>
      <dc:date>2021-06-04T19:55:49Z</dc:date>
    </item>
    <item>
      <title>Re: PROC template Graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745919#M21636</link>
      <description>&lt;P&gt;&lt;FONT face="times new roman,times" size="4"&gt;Hello Jeff, &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="times new roman,times" size="4"&gt;You are on point. It sure looks better without legend on every single graph. Thank you.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jun 2021 21:12:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745919#M21636</guid>
      <dc:creator>Adeoye</dc:creator>
      <dc:date>2021-06-04T21:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: PROC template Graph</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745925#M21637</link>
      <description>You should select Jeff's answer as the correct one, I think if you click the three dots at the side of my post you can unmark mine and mark his as correct &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Fri, 04 Jun 2021 21:22:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-template-Graph/m-p/745925#M21637</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-06-04T21:22:26Z</dc:date>
    </item>
  </channel>
</rss>

