<?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 sgplot &amp;gt; xaxistable &amp;gt; label colors jumping when a particular class missing in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-sgplot-gt-xaxistable-gt-label-colors-jumping-when-a/m-p/872748#M344800</link>
    <description>&lt;P&gt;Sorry typo in this part:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data myattrmap;
  length linecolor fillcolor textcolor $ 10;

  id="myid"; value="M";
  linecolor="blue"; fillcolor="blue";
  textcolor="blue"; textstyle="normal";
  textweight="normal";
output;

id="myid"; value="F";
  linecolor="red"; fillcolor="pink";
  textcolor="red"; textstyle="italic";
  textweight="bold";
output;

  id="myid"; value="U";
  linecolor="green"; fillcolor="yellow";
  textcolor="green"; textstyle="italic";
  textweight="bold";
output;

run;
proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="yabwon_0-1682667293619.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/83360iDF85763D96D8E161/image-size/medium?v=v2&amp;amp;px=400" role="button" title="yabwon_0-1682667293619.png" alt="yabwon_0-1682667293619.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Apr 2023 07:34:57 GMT</pubDate>
    <dc:creator>yabwon</dc:creator>
    <dc:date>2023-04-28T07:34:57Z</dc:date>
    <item>
      <title>proc sgplot &gt; xaxistable &gt; label colors jumping when a particular class missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sgplot-gt-xaxistable-gt-label-colors-jumping-when-a/m-p/872580#M344729</link>
      <description>&lt;P&gt;Hi Experts,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to create a vital signs graph by each parameter like temp, weight in each page per treatment group (total 5 TRTGRPs).&amp;nbsp;&amp;nbsp;I have problem in assigning colors and creating sgplot xaxistable even after using discrete table for assigning attributes consistently.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When all 5 TRTGRPS are present for a particular parameter, colors are assigned properly (Eg: Page2). However, when a TRTGRP is missing, color gets replaced with the missing ones and this causes misrepresentation in graph (Eg: page2). Is there a way to avoid this overlapping of color when any other class (treatment group is missing).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please note: TRTGRP3 is missing at page 1 and TRTGRP4 picks green color, but it is supposed to be purple as per TRT order.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jksthomas_1-1682603641325.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/83336i0FD68742F721BE83/image-size/medium?v=v2&amp;amp;px=400" role="button" title="jksthomas_1-1682603641325.png" alt="jksthomas_1-1682603641325.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data discgrp;&lt;BR /&gt;retain id "discgrp" linecolor "black" ;&lt;BR /&gt;length fillcolor $20;&lt;BR /&gt;value='TRTGRP1'; fillcolor='red'; output;&lt;BR /&gt;value='TRTGRP2'; fillcolor='blue'; output;&lt;BR /&gt;value='TRTGRP3'; fillcolor='green'; output;&lt;BR /&gt;value='TRTGRP4'; fillcolor='purple'; output;&lt;BR /&gt;value='TRTGRP5'; fillcolor='black'; output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 14:05:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sgplot-gt-xaxistable-gt-label-colors-jumping-when-a/m-p/872580#M344729</guid>
      <dc:creator>jksthomas</dc:creator>
      <dc:date>2023-04-27T14:05:17Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot &gt; xaxistable &gt; label colors jumping when a particular class missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sgplot-gt-xaxistable-gt-label-colors-jumping-when-a/m-p/872581#M344730</link>
      <description>&lt;P&gt;You need to define a discrete attribute map in SAS. &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/grstatproc/n0ekpvuwp1lvc1n1u40ksxbiixil.htm" target="_blank"&gt;Example:&amp;nbsp;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatgraph/n06cil5e9uw87mn1n7pzfefidh04.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Apr 2023 14:10:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sgplot-gt-xaxistable-gt-label-colors-jumping-when-a/m-p/872581#M344730</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-04-27T14:10:34Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot &gt; xaxistable &gt; label colors jumping when a particular class missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sgplot-gt-xaxistable-gt-label-colors-jumping-when-a/m-p/872736#M344793</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;for your inputs. I have used the same discrete attrib map to pick pick up the attibutes. however if one value is missed out, next value picks up the color of the missed one.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Eg: from the link you shared.&lt;/P&gt;&lt;P&gt;If graph is breakdown into 2 page and one page have 2 values both "M" and "F", but the second page of graph has only "F", "F" picks up the color of "M" even after assigning discrete attribute mapping. Is there any option to prevent it?&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 06:07:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sgplot-gt-xaxistable-gt-label-colors-jumping-when-a/m-p/872736#M344793</guid>
      <dc:creator>jksthomas</dc:creator>
      <dc:date>2023-04-28T06:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot &gt; xaxistable &gt; label colors jumping when a particular class missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sgplot-gt-xaxistable-gt-label-colors-jumping-when-a/m-p/872745#M344799</link>
      <description>&lt;P&gt;Are you sure you don't have some mismatch in values assignment?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did some tests and it picks up colours properly.&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data myattrmap;
  id="myid"; value="M";
  linecolor="blue"; fillcolor="blue";
  textcolor="blue"; textstyle="normal";
  textweight="normal";
output;

id="myid"; value="F";
  linecolor="red"; fillcolor="pink";
  textcolor="red"; textstyle="italic";
  textweight="bold";
output;

id="myid"; value="U";
  linecolor="green"; fillcolor="yelow";
  textcolor="green"; textstyle="italic";
  textweight="bold";
output;

run;


data class; 
set 
sashelp.class(in=a)
sashelp.class(in=u1)
sashelp.class(in=b where=(sex="M"))
sashelp.class(in=c where=(sex="F"))
;
if u1 then sex="U";
grp=b+2*c;

output;

if b then do;
  sex="U";
  output;
end;
run;

ods PDF file="C:\test.pdf";
proc sgplot data=class dattrmap=myattrmap;
  by grp;
  vbar age / response=height group=sex stat=mean
     groupdisplay=cluster attrid=myid;
  xaxistable weight / textgroup=sex 
     textgroupid=myid;
run;

ods PDF close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="yabwon_0-1682666857670.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/83359iFBB25132FBA319AB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="yabwon_0-1682666857670.png" alt="yabwon_0-1682666857670.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 07:28:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sgplot-gt-xaxistable-gt-label-colors-jumping-when-a/m-p/872745#M344799</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-04-28T07:28:29Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot &gt; xaxistable &gt; label colors jumping when a particular class missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sgplot-gt-xaxistable-gt-label-colors-jumping-when-a/m-p/872748#M344800</link>
      <description>&lt;P&gt;Sorry typo in this part:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data myattrmap;
  length linecolor fillcolor textcolor $ 10;

  id="myid"; value="M";
  linecolor="blue"; fillcolor="blue";
  textcolor="blue"; textstyle="normal";
  textweight="normal";
output;

id="myid"; value="F";
  linecolor="red"; fillcolor="pink";
  textcolor="red"; textstyle="italic";
  textweight="bold";
output;

  id="myid"; value="U";
  linecolor="green"; fillcolor="yellow";
  textcolor="green"; textstyle="italic";
  textweight="bold";
output;

run;
proc print;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="yabwon_0-1682667293619.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/83360iDF85763D96D8E161/image-size/medium?v=v2&amp;amp;px=400" role="button" title="yabwon_0-1682667293619.png" alt="yabwon_0-1682667293619.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 07:34:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sgplot-gt-xaxistable-gt-label-colors-jumping-when-a/m-p/872748#M344800</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-04-28T07:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot &gt; xaxistable &gt; label colors jumping when a particular class missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sgplot-gt-xaxistable-gt-label-colors-jumping-when-a/m-p/872764#M344806</link>
      <description>&lt;P&gt;Agreeing with &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt; , the discrete attribute maps eliminate this problem of different categories missing in different plots. Not only has that been my own experience in this situation, but SAS says it will do that in the documentation (which I trust highly — that doesn't mean there has never been mistakes in the documentation, but when they say something will work, and I get it to work, which is 99.9% or more of the time, I have tremendous confidence in the documentation). &lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 10:16:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sgplot-gt-xaxistable-gt-label-colors-jumping-when-a/m-p/872764#M344806</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-04-28T10:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: proc sgplot &gt; xaxistable &gt; label colors jumping when a particular class missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-sgplot-gt-xaxistable-gt-label-colors-jumping-when-a/m-p/873309#M345046</link>
      <description>&lt;P&gt;Thanks a lot&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/35763"&gt;@yabwon&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;&amp;nbsp;for your inputs. Let me check again my codes and get back on outcome. Thanks again &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 May 2023 06:39:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-sgplot-gt-xaxistable-gt-label-colors-jumping-when-a/m-p/873309#M345046</guid>
      <dc:creator>jksthomas</dc:creator>
      <dc:date>2023-05-02T06:39:39Z</dc:date>
    </item>
  </channel>
</rss>

