<?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 PROC SGPANEL how to avoid inconsistent colors by group? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPANEL-how-to-avoid-inconsistent-colors-by-group/m-p/896999#M24129</link>
    <description>&lt;P&gt;Hello Community,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;My group values are not getting consistently colored across all groups. I found a similar topic with PROC SGPLOT &lt;A href="https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-How-to-get-consistent-colors-across-BY-groups/td-p/668774" target="_self"&gt;where&lt;/A&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10604"&gt;@djrisks&lt;/a&gt;&amp;nbsp;gave a solution using&amp;nbsp;&lt;SPAN&gt;Discrete Attribute Maps method. I'm wondering if this technique works for SGPANEL as well or there are different ways to get consistent colors by group values.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;For clarity I used the below code (where 'yellow' represents&amp;nbsp; Cylinders=10&amp;nbsp; in SUV group and Cylinders=12&amp;nbsp; in Sports group. I need 'yellow' to represent only Cylinders=10).&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;		proc sort data=sashelp.cars out=cars; by origin type; run; 

		proc freq data=cars;
			where cylinders in (4 5 6 8 10 12); 
			by origin;
			tables type*cylinders/out=have totpct outpct;
		run; 
		
		title 'SUV cars';
		proc SGPANEL data=have;
			where type eq "SUV";
			panelby origin;
			styleattrs datacolors=(blue red green yellow orange purple);
			vbar type / response=pct_row group=cylinders groupdisplay=stack;
			colaxis discreteorder=data valueattrs=(size=7pt) fitpolicy=rotate label="Cylinders";;
			rowaxis grid values=(0 to 100 by 10) label="Percent";
		run;

		title 'Sports cars';
		proc SGPANEL data=have;
			where type eq "Sports";
			panelby origin;
			styleattrs datacolors=(blue red green yellow orange purple);
			vbar type / response=pct_row group=cylinders groupdisplay=stack;
			colaxis discreteorder=data valueattrs=(size=7pt) fitpolicy=rotate label="Cylinders";;
			rowaxis grid values=(0 to 100 by 10) label="Percent";
		run;
		title; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;Any help much appreciated.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 03 Oct 2023 17:47:56 GMT</pubDate>
    <dc:creator>A_Kh</dc:creator>
    <dc:date>2023-10-03T17:47:56Z</dc:date>
    <item>
      <title>PROC SGPANEL how to avoid inconsistent colors by group?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPANEL-how-to-avoid-inconsistent-colors-by-group/m-p/896999#M24129</link>
      <description>&lt;P&gt;Hello Community,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;My group values are not getting consistently colored across all groups. I found a similar topic with PROC SGPLOT &lt;A href="https://communities.sas.com/t5/Graphics-Programming/PROC-SGPLOT-How-to-get-consistent-colors-across-BY-groups/td-p/668774" target="_self"&gt;where&lt;/A&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10604"&gt;@djrisks&lt;/a&gt;&amp;nbsp;gave a solution using&amp;nbsp;&lt;SPAN&gt;Discrete Attribute Maps method. I'm wondering if this technique works for SGPANEL as well or there are different ways to get consistent colors by group values.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;For clarity I used the below code (where 'yellow' represents&amp;nbsp; Cylinders=10&amp;nbsp; in SUV group and Cylinders=12&amp;nbsp; in Sports group. I need 'yellow' to represent only Cylinders=10).&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;		proc sort data=sashelp.cars out=cars; by origin type; run; 

		proc freq data=cars;
			where cylinders in (4 5 6 8 10 12); 
			by origin;
			tables type*cylinders/out=have totpct outpct;
		run; 
		
		title 'SUV cars';
		proc SGPANEL data=have;
			where type eq "SUV";
			panelby origin;
			styleattrs datacolors=(blue red green yellow orange purple);
			vbar type / response=pct_row group=cylinders groupdisplay=stack;
			colaxis discreteorder=data valueattrs=(size=7pt) fitpolicy=rotate label="Cylinders";;
			rowaxis grid values=(0 to 100 by 10) label="Percent";
		run;

		title 'Sports cars';
		proc SGPANEL data=have;
			where type eq "Sports";
			panelby origin;
			styleattrs datacolors=(blue red green yellow orange purple);
			vbar type / response=pct_row group=cylinders groupdisplay=stack;
			colaxis discreteorder=data valueattrs=(size=7pt) fitpolicy=rotate label="Cylinders";;
			rowaxis grid values=(0 to 100 by 10) label="Percent";
		run;
		title; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;Any help much appreciated.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2023 17:47:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPANEL-how-to-avoid-inconsistent-colors-by-group/m-p/896999#M24129</guid>
      <dc:creator>A_Kh</dc:creator>
      <dc:date>2023-10-03T17:47:56Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPANEL how to avoid inconsistent colors by group?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPANEL-how-to-avoid-inconsistent-colors-by-group/m-p/897002#M24130</link>
      <description>&lt;P&gt;Use discrete attribute maps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.lexjansen.com/sesug/2021/SESUG2021_Paper_77_Final_PDF.pdf" target="_blank"&gt;https://www.lexjansen.com/sesug/2021/SESUG2021_Paper_77_Final_PDF.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings19/3794-2019.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings19/3794-2019.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Oct 2023 17:54:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPANEL-how-to-avoid-inconsistent-colors-by-group/m-p/897002#M24130</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-10-03T17:54:32Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPANEL how to avoid inconsistent colors by group?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPANEL-how-to-avoid-inconsistent-colors-by-group/m-p/897092#M24131</link>
      <description>Or for your this special case. Try options SPARSE :&lt;BR /&gt;tables type*cylinders/out=have totpct outpct;&lt;BR /&gt;&lt;BR /&gt;--&amp;gt;&lt;BR /&gt;			tables type*cylinders/out=have totpct outpct sparse;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 04 Oct 2023 02:40:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPANEL-how-to-avoid-inconsistent-colors-by-group/m-p/897092#M24131</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2023-10-04T02:40:27Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPANEL how to avoid inconsistent colors by group?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPANEL-how-to-avoid-inconsistent-colors-by-group/m-p/897158#M24132</link>
      <description>&lt;P&gt;Thank you so much, it works perfectly!&lt;/P&gt;
&lt;P&gt;And the most efficient way.&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2023 14:21:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPANEL-how-to-avoid-inconsistent-colors-by-group/m-p/897158#M24132</guid>
      <dc:creator>A_Kh</dc:creator>
      <dc:date>2023-10-04T14:21:59Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SGPANEL how to avoid inconsistent colors by group?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPANEL-how-to-avoid-inconsistent-colors-by-group/m-p/897160#M24133</link>
      <description>&lt;P&gt;Thank you for the quick reply and tips!&lt;BR /&gt;As documentation focused on SGPLOT procedure, I couldn't replicate it in my SGPANEL.. But appreciate sharing those info with me!!&lt;/P&gt;</description>
      <pubDate>Wed, 04 Oct 2023 14:25:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/PROC-SGPANEL-how-to-avoid-inconsistent-colors-by-group/m-p/897160#M24133</guid>
      <dc:creator>A_Kh</dc:creator>
      <dc:date>2023-10-04T14:25:58Z</dc:date>
    </item>
  </channel>
</rss>

