<?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: SGPLOT VS SGPANEL in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/SGPLOT-VS-SGPANEL/m-p/273764#M58468</link>
    <description>Hi:&lt;BR /&gt;  PATTERNID is for PROC GCHART. You use different methods with SGPLOT. Can you post the SGPLOT code or code showing SGPLOT and PATTERNID that worked?&lt;BR /&gt;&lt;BR /&gt;cynthia</description>
    <pubDate>Sat, 28 May 2016 14:15:08 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2016-05-28T14:15:08Z</dc:date>
    <item>
      <title>SGPLOT VS SGPANEL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SGPLOT-VS-SGPANEL/m-p/273762#M58467</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So I have this question for you. I have a stacked bargraph that I produced using SGPLOT, where I created textured fill to distinguish between subgroups using patternid. But, I could not replicate that in SGPANEL, where bars are stacked by subgroup, and then there are different plots for differenet groups, thats why using sgpanel.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think I can do it using template, but is there an easier way ? Maybe, a optin like patternid in SGPLOT? My search did not yield any results.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a bunch in advance !&lt;/P&gt;</description>
      <pubDate>Sat, 28 May 2016 13:10:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SGPLOT-VS-SGPANEL/m-p/273762#M58467</guid>
      <dc:creator>cd2011</dc:creator>
      <dc:date>2016-05-28T13:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT VS SGPANEL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SGPLOT-VS-SGPANEL/m-p/273764#M58468</link>
      <description>Hi:&lt;BR /&gt;  PATTERNID is for PROC GCHART. You use different methods with SGPLOT. Can you post the SGPLOT code or code showing SGPLOT and PATTERNID that worked?&lt;BR /&gt;&lt;BR /&gt;cynthia</description>
      <pubDate>Sat, 28 May 2016 14:15:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SGPLOT-VS-SGPANEL/m-p/273764#M58468</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-05-28T14:15:08Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT VS SGPANEL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SGPLOT-VS-SGPANEL/m-p/273768#M58470</link>
      <description>&lt;P&gt;You might be right. I dont have the code file with me so I cant check. But it could be gchart. I will check if it worked with SGPLOT and post an update. But definitely did not work with SGPANEL.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 28 May 2016 16:04:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SGPLOT-VS-SGPANEL/m-p/273768#M58470</guid>
      <dc:creator>cd2011</dc:creator>
      <dc:date>2016-05-28T16:04:56Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT VS SGPANEL</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SGPLOT-VS-SGPANEL/m-p/273779#M58471</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; You cannot "mix" SAS/GRAPH controls or SAS/GRAPH procedures with ODS GRAPHICS controls and ODS GRAPHICS procedures. So PROC GCHART will not work with SGPANEL.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; However, a modification of this Tech Support example, &lt;A href="http://support.sas.com/kb/45/663.html" target="_blank"&gt;http://support.sas.com/kb/45/663.html&lt;/A&gt; worked for me with SGPLOT and SGPANEL.&lt;/P&gt;
&lt;P&gt;cynthia&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;*** the code;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods path work.tmp(update) sasuser.templat(update) sashelp.tmplmst(read);
  
proc template;
   define style mypatterns;
   parent=styles.rtf;

   /* The GraphBar element must be included with the
      FILLPATTERN option in order to use fill patterns. */
   style GraphBar from GraphComponent /                                 
         displayopts = "outline fillpattern";  
   
   /* Fill patterns are defined using the FILLPATTERN 
	  style element attribute. 
	  COLOR is used for the bar fill colors
	  CONTRASTCOLOR is used for the line colors */

      style GraphData1 from GraphData1 /                                      
            fillpattern = "L3"
            color=cxDADAEB
            contrastcolor=cx252525;                                                  
      style GraphData2 from GraphData2 /
            fillpattern = "R3"
            color=cxBCBDDC
            contrastcolor=cx636363;                                                  
      style GraphData3 from GraphData3 /                                      
            fillpattern = "X5"
            color=cx9E9AC8
            contrastcolor=cxCCCCCC;                                                  
      style GraphData4 from GraphData4 /                                      
            fillpattern = "L5"
            color=cx756BB1
            contrastcolor=cxBDBDBD;                                                  
      style GraphData5 from GraphData5 /                                      
            fillpattern = "X2"
            color=cx6A51A3
            contrastcolor=grayaa;    
     end;
run;

options nodate number;
ods pdf file='c:\temp\pat_sg_pan_ex1a.pdf' style=mypatterns;
ods html gpath='c:\temp' (url=none)
         path='c:\temp' (url=none) 
         file='pat_sg_pan_ex1b.html' style=mypatterns;
ods rtf file='c:\temp\pat_sg_pan_ex1c.rtf' style=mypatterns;

title 'Using fill patterns with a bar chart';

data sample;
   length grpvar $8;
   input mid $ value;
   do supergroup = 'Z1', 'Z2';
     do grpvar='One', 'Two', 'Three';
       if grpvar = 'One' then output;
	   else if grpvar = 'Two' then do;
	      value = value + 3;
		  output;
	   end;
	   else do;
	     value = value + 5;
	     output;
	   end;
     end;
   end;
return;
datalines;
A 10
B 20
C 25
;
run;

** plot one "supergroup";
proc sgplot data=sample noautolegend;
   where supergroup = 'Z1';
   vbar mid / response=value stat=mean group=grpvar groupdisplay=cluster 
              grouporder=data name="Bar";
xaxis label="Grouped";
yaxis label="Mean" values=(0 to 35 by 5);
keylegend "Bar" / title="Wombat" ;
run;

** plot both "supergroups" with SGPANEL;
proc sgpanel data=sample;
   panelby supergroup;
   vbar mid / response=value stat=mean group=grpvar groupdisplay=cluster 
              grouporder=data name="Bar2";
colaxis label="Grouped";
rowaxis label="Mean" values=(0 to 50 by 5);
run;
ods _all_ close;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;*** the output;&lt;/P&gt;
&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/3376iCB6880B52B59DA0B/image-size/original?v=v2&amp;amp;px=-1" alt="sgplot_sgpanel_pattern.png" title="sgplot_sgpanel_pattern.png" border="0" /&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 28 May 2016 20:57:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SGPLOT-VS-SGPANEL/m-p/273779#M58471</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2016-05-28T20:57:51Z</dc:date>
    </item>
  </channel>
</rss>

