<?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: Boundary for band in SGPLOT in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Boundary-for-band-in-SGPLOT/m-p/887259#M39372</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/426087"&gt;@linlin87&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think the issue is that you specify a constant value in the UPPER= option of the BAND statement rather than the variable UP1, which you defined in the BOUNDARY dataset. So try this:&lt;/P&gt;
&lt;PRE&gt;band x=x upper=&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;up1&lt;/STRONG&gt;&lt;/FONT&gt; lower=-0.002 / fillattrs=(transparency=0.5 color=gray);&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Depending on the content of dataset PLOT_DATA and how you use it in your real PROC SGPLOT step, other techniques to limit the gray box include:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatproc/n1t2ihc734azuvn17021ri2cl057.htm#n05xp1zg1to1rzn1fyr6abc1rgd1" target="_blank" rel="noopener"&gt;NOEXTEND option&lt;/A&gt;&amp;nbsp;of the BAND statement&lt;/LI&gt;
&lt;LI&gt;defining a step function in the BOUNDARY dataset:&lt;BR /&gt;
&lt;PRE&gt;data boundary;
do x = -0.002 to 0.005 by .0001; 
  x=round(x,1e-9);
&lt;STRONG&gt;  if x&amp;lt;=0 then up1=0;
  else up1=-0.002;&lt;/STRONG&gt;
  output;
end;
run;&lt;/PRE&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;If the box doesn't look exactly rectangular, you may also want to add the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatproc/n1t2ihc734azuvn17021ri2cl057.htm#n0in2f8tng8krdn1lgvj9fz45fpn" target="_blank" rel="noopener"&gt;TYPE=STEP option&lt;/A&gt; to the BAND statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 01 Aug 2023 09:31:39 GMT</pubDate>
    <dc:creator>FreelanceReinh</dc:creator>
    <dc:date>2023-08-01T09:31:39Z</dc:date>
    <item>
      <title>Boundary for band in SGPLOT</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Boundary-for-band-in-SGPLOT/m-p/887255#M39371</link>
      <description>&lt;P&gt;Hello SAS Community,&lt;BR /&gt;&lt;BR /&gt;I use band to annotate graph with gray box. But I need box to finish at x=0, and it keep going. How I stop the grey box at 0, just get the yellow area (below)?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="linlin87_0-1690878827221.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/86324i8311BBDEC85D14CA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="linlin87_0-1690878827221.png" alt="linlin87_0-1690878827221.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I use code:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data boundary;
do x = -0.002 to 0 by .00001;            
	up1=0;
	output;
end;
run;
 
data plot;
set plot_data boundary;
run;

proc sgplot data=plot;
   band x=x upper=0 lower=-0.002 / fillattrs=(transparency=0.5 color=gray);
   yaxis max = 0.005 grid;
   xaxis max = 0.005 grid;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Thank you for help!&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2023 08:36:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Boundary-for-band-in-SGPLOT/m-p/887255#M39371</guid>
      <dc:creator>linlin87</dc:creator>
      <dc:date>2023-08-01T08:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: Boundary for band in SGPLOT</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Boundary-for-band-in-SGPLOT/m-p/887259#M39372</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/426087"&gt;@linlin87&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think the issue is that you specify a constant value in the UPPER= option of the BAND statement rather than the variable UP1, which you defined in the BOUNDARY dataset. So try this:&lt;/P&gt;
&lt;PRE&gt;band x=x upper=&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;up1&lt;/STRONG&gt;&lt;/FONT&gt; lower=-0.002 / fillattrs=(transparency=0.5 color=gray);&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Depending on the content of dataset PLOT_DATA and how you use it in your real PROC SGPLOT step, other techniques to limit the gray box include:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatproc/n1t2ihc734azuvn17021ri2cl057.htm#n05xp1zg1to1rzn1fyr6abc1rgd1" target="_blank" rel="noopener"&gt;NOEXTEND option&lt;/A&gt;&amp;nbsp;of the BAND statement&lt;/LI&gt;
&lt;LI&gt;defining a step function in the BOUNDARY dataset:&lt;BR /&gt;
&lt;PRE&gt;data boundary;
do x = -0.002 to 0.005 by .0001; 
  x=round(x,1e-9);
&lt;STRONG&gt;  if x&amp;lt;=0 then up1=0;
  else up1=-0.002;&lt;/STRONG&gt;
  output;
end;
run;&lt;/PRE&gt;
&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;If the box doesn't look exactly rectangular, you may also want to add the &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatproc/n1t2ihc734azuvn17021ri2cl057.htm#n0in2f8tng8krdn1lgvj9fz45fpn" target="_blank" rel="noopener"&gt;TYPE=STEP option&lt;/A&gt; to the BAND statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Aug 2023 09:31:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Boundary-for-band-in-SGPLOT/m-p/887259#M39372</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2023-08-01T09:31:39Z</dc:date>
    </item>
  </channel>
</rss>

