<?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: Removing the colorbands from forestplot PROC SGPLOT in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Removing-the-colorbands-from-forestplot-PROC-SGPLOT/m-p/837376#M23204</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp; I am new at sgplot and , yes it's borrowed code.&amp;nbsp; I got confused between two refline statements and colorbands options in Y axis, So I was not sure which one causing the&amp;nbsp; bands, I thought it was like graph wall display.&lt;/P&gt;
&lt;P&gt;Thanks you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13856"&gt;@Jay54&lt;/a&gt;&amp;nbsp; and you for pinpointing the&amp;nbsp; statement. It worked for me ( I tried removing the refline statement or changing the lineattrs color= white. Can you guys please spare some time what these statement/ or options do in quick a way.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SASuserlot_0-1665147464955.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76010i14C97748072DAD3E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SASuserlot_0-1665147464955.png" alt="SASuserlot_0-1665147464955.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;As per numbering in Image:&lt;/P&gt;
&lt;P&gt;1. I was expecting that it creates the solid reference line at 1 on x axis. How I can change the color /pattern of this line if I want give line attrs&amp;nbsp; options on this statement?&lt;/P&gt;
&lt;P&gt;2. Commented code: it controls the attributes of the above reference line such as color, thickness, or pattern. But Look like I am wrong&lt;span class="lia-unicode-emoji" title=":persevering_face:"&gt;😣&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;3. What is the option color bands do in general? I expected the background color came from this option where the transparency of the color, and even and odd location can be changed here. But I am wrong again. here.&lt;/P&gt;</description>
    <pubDate>Fri, 07 Oct 2022 13:03:32 GMT</pubDate>
    <dc:creator>SASuserlot</dc:creator>
    <dc:date>2022-10-07T13:03:32Z</dc:date>
    <item>
      <title>Removing the colorbands from forestplot PROC SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Removing-the-colorbands-from-forestplot-PROC-SGPLOT/m-p/837307#M23200</link>
      <description>&lt;P&gt;I am having the difficulty to to remove the transparent color bands. I tried removing the option colorbands, it did not worked me. what I am doing wrong? is it because of "ods listing style= htmlblue" ? thanks in advance.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SASuserlot_0-1665099818953.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76006i1C98ED3562CD826E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SASuserlot_0-1665099818953.png" alt="SASuserlot_0-1665099818953.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data class ;
	set sashelp.class ;
	  obsid=_n_;

 if _n_ &amp;lt;=4 then do;
 *Creating lcl negative values  and affecting the x axis in macro;
	  HR=0.042;
	  lcl=HR-0.052;
	  ucl=HR+0.01;
	  name1 = name||"its long name";
	  pvalue=0.019;

  end;
  else if _n_ &amp;gt;=5 and _n_&amp;lt;=9 then do;
	  HR=0.083;
	  lcl=HR-0.02;
	  ucl=HR+0.1;
	  name1=name;
	  pvalue=0.089;

  end;

  else if _n_ &amp;gt;=10 and _n_&amp;lt;=15 then do;
	  HR=0.346;
	  lcl=HR-0.11;
	  ucl=HR+0.3;
	  name1=name;
	  pvalue=0.004;

  end;

  else   do;
	  HR=0.449;
	  lcl=HR-0.21;
	  ucl=HR+0.3;
	  name1=name;
	  pvalue=0.45;
  end;

  Groupid=1;
  id= groupid;
 keep  hr ucl name1 lcl pvalue groupid obsid id;
run;

/*ods html;*/
/*proc print;run;*/
/*ods html close;*/

/*--Set indent weight, add insets and horizontal bands--*/
data class2;
  set class nobs=n end=last;
  length text $20;
  val=mod(_N_-1, 6);
  if val eq 1 or val eq 2 or val eq 3 then ref=obsid;

  /*--Separate Subgroup headers and obs into separate columns--*/
  indentwt=1;
  if id=1 then indentWt=0;

  output;
  if last then do;
    call missing (name1, pvalue, ucl, lcl, groupid, obsid);
        obsid=n+1; 
    xl=0.4; yl=n+1; text='P'; output;;
        xl=1.7; yl=n+1; text='T'; output;
  end;
/*   if count ne .;*/
  run;

/*--Define Format with Unicode for the left and right arrows--*/
proc format;;
  value $txt
  "T" = "Therapy Better (*ESC*){Unicode '2192'x}"
  "P" = "(*ESC*){Unicode '2190'x} PCI Better";
run;

/*--Attribute maps for Subgroup Test attributes--*/
data attrmap;
  length textweight $10;
  id='text'; value='1'; textcolor='Black'; textsize=7; textweight='bold'; output;
  id='text'; value='2'; textcolor='Black'; textsize=5; textweight='normal'; output;
run;
ods html;
/*--Forest Plot--*/
options missing=' ';
/*ods listing style=htmlBlue;*/
title j=r h=7pt '4-Yr Cumulative Event Rate';
ods graphics / reset width=5in height=3in imagename='Subgroup_Forest_SG_94';
proc sgplot data=class2 nowall noborder nocycleattrs dattrmap=attrmap noautolegend;
  format text $txt.;
  styleattrs axisextent=data;
  refline ref / lineattrs=(thickness=13 color=cxf0f0f7);
  highlow y=obsid low=lcl high=ucl; 
  scatter y=obsid x=hr / markerattrs=(symbol=squarefilled);
  scatter y=obsid x=hr / markerattrs=(size=0) x2axis;
  refline 1 / axis=x;
  text x=xl y=obsid text=text / position=bottom contributeoffsets=none strip;
  yaxistable name1  / location=inside position=left textgroup=id labelattrs=(size=7) 
             textgroupid=text indentweight=indentWt;
/*  yaxistable countpct / location=inside position=left labelattrs=(size=7) valueattrs=(size=7);*/
  yaxistable lcl ucl pvalue / location=inside position=right pad=(right=15px) 
             labelattrs=(size=7) valueattrs=(size=7);
  yaxis reverse display=none; *colorbands=odd colorbandsattrs=(transparency=1) offsetmin=0.0;
  xaxis display=(nolabel) values=(0.0 0.5 1.0 1.5 2.0 2.5);
  x2axis label='Hazard Ratio' display=(noline noticks novalues) labelattrs=(size=8);
run;


&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 06 Oct 2022 23:44:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Removing-the-colorbands-from-forestplot-PROC-SGPLOT/m-p/837307#M23200</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2022-10-06T23:44:04Z</dc:date>
    </item>
    <item>
      <title>Re: Removing the colorbands from forestplot PROC SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Removing-the-colorbands-from-forestplot-PROC-SGPLOT/m-p/837313#M23201</link>
      <description>&lt;P&gt;Maybe remove the reflines.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 01:52:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Removing-the-colorbands-from-forestplot-PROC-SGPLOT/m-p/837313#M23201</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2022-10-07T01:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: Removing the colorbands from forestplot PROC SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Removing-the-colorbands-from-forestplot-PROC-SGPLOT/m-p/837328#M23202</link>
      <description>&lt;P&gt;Comment out or remove this line:&lt;/P&gt;
&lt;PRE&gt;  refline ref / lineattrs=(thickness=13 color=cxf0f0f7);
&lt;/PRE&gt;
&lt;P&gt;and those shaded areas go away.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Borrowed code without understanding what the REF variable was used for?&lt;/P&gt;
&lt;P&gt;Or attempting to do something else that did not work?&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 07:34:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Removing-the-colorbands-from-forestplot-PROC-SGPLOT/m-p/837328#M23202</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-10-07T07:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: Removing the colorbands from forestplot PROC SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Removing-the-colorbands-from-forestplot-PROC-SGPLOT/m-p/837376#M23204</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp; I am new at sgplot and , yes it's borrowed code.&amp;nbsp; I got confused between two refline statements and colorbands options in Y axis, So I was not sure which one causing the&amp;nbsp; bands, I thought it was like graph wall display.&lt;/P&gt;
&lt;P&gt;Thanks you&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13856"&gt;@Jay54&lt;/a&gt;&amp;nbsp; and you for pinpointing the&amp;nbsp; statement. It worked for me ( I tried removing the refline statement or changing the lineattrs color= white. Can you guys please spare some time what these statement/ or options do in quick a way.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SASuserlot_0-1665147464955.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/76010i14C97748072DAD3E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SASuserlot_0-1665147464955.png" alt="SASuserlot_0-1665147464955.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;As per numbering in Image:&lt;/P&gt;
&lt;P&gt;1. I was expecting that it creates the solid reference line at 1 on x axis. How I can change the color /pattern of this line if I want give line attrs&amp;nbsp; options on this statement?&lt;/P&gt;
&lt;P&gt;2. Commented code: it controls the attributes of the above reference line such as color, thickness, or pattern. But Look like I am wrong&lt;span class="lia-unicode-emoji" title=":persevering_face:"&gt;😣&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;3. What is the option color bands do in general? I expected the background color came from this option where the transparency of the color, and even and odd location can be changed here. But I am wrong again. here.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 13:03:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Removing-the-colorbands-from-forestplot-PROC-SGPLOT/m-p/837376#M23204</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2022-10-07T13:03:32Z</dc:date>
    </item>
    <item>
      <title>Re: Removing the colorbands from forestplot PROC SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Removing-the-colorbands-from-forestplot-PROC-SGPLOT/m-p/837377#M23205</link>
      <description>&lt;P&gt;It worked. Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 13:04:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Removing-the-colorbands-from-forestplot-PROC-SGPLOT/m-p/837377#M23205</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2022-10-07T13:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: Removing the colorbands from forestplot PROC SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Removing-the-colorbands-from-forestplot-PROC-SGPLOT/m-p/837422#M23208</link>
      <description>&lt;P&gt;Suggest that you read the documentation from the syntax for options. That way you know where to look them up when you need them.&lt;/P&gt;
&lt;P&gt;Either &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/grstatproc/p1t32i8511t1gfn17sw07yxtazad.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/grstatproc/p1t32i8511t1gfn17sw07yxtazad.htm&lt;/A&gt; or your online help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your code does create a solid reference line at 1 on the X axis. Why do you think it doesn't.&lt;/P&gt;
&lt;P&gt;Each REF statement is separate. If want multiple options applied to one reference line, or group, then all the options go on one statement. Your 'Ref Ref ' statement had only some reference lines because of the way that you assigned the values to the variable ref. Why they are done that way was one of the reasons I asked if this was borrowed code as you should have expected something there.&amp;nbsp; Color, pattern and thickness are the only options for LINEATTRS. Transparency is a separate option.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;COLORBANDS only affects discrete axis. So since your Y axis is not explicitly set to discrete such options aren't typically applied. The option would alternate background color at the midpoints between tick mark values.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 15:18:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Removing-the-colorbands-from-forestplot-PROC-SGPLOT/m-p/837422#M23208</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-10-07T15:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: Removing the colorbands from forestplot PROC SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Removing-the-colorbands-from-forestplot-PROC-SGPLOT/m-p/837431#M23209</link>
      <description>&lt;P&gt;I understood better now. Thanks for the document. I definitely need to read that.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 15:47:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Removing-the-colorbands-from-forestplot-PROC-SGPLOT/m-p/837431#M23209</guid>
      <dc:creator>SASuserlot</dc:creator>
      <dc:date>2022-10-07T15:47:01Z</dc:date>
    </item>
  </channel>
</rss>

