<?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: SGANNO Overwhelms SGPLOT in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/689252#M20562</link>
    <description>&lt;P&gt;I would then suggest looking at my earlier example using the BLOCK plot.&amp;nbsp; If you have or can calculate a variable that is equal to 1 whenever you want it shaded and can make it 0 when you don't want it shaded, you can use the BLOCK plot to alternate the shading like in my example.&amp;nbsp; Then SGPLOT would automatically limit where the shading happens (it won't draw it outside the axes like annotation does).&amp;nbsp; I don't have your exact data to give a more specific example.&lt;/P&gt;</description>
    <pubDate>Tue, 06 Oct 2020 15:43:59 GMT</pubDate>
    <dc:creator>JeffMeyers</dc:creator>
    <dc:date>2020-10-06T15:43:59Z</dc:date>
    <item>
      <title>SGANNO Overwhelms SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/688969#M20549</link>
      <description>&lt;P&gt;Updated: The following MWE better shows my situation.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	input id :$16. @@;
	f=compress("https://fred.stlouisfed.org/graph/fredgraph.csv?id="||id);
	infile _ url filevar=f firstobs=2 dsd truncover end=e;
	do until(e);
		input date yymmdd10. +1 value;
		if value&amp;gt;. then output;
	end;
cards;
will5000indfc indpro sp500 unrate dexuseu cpiaucsl gdp dgs10 fedfunds
;

data sganno(drop=v);
	display="fill";
	fillcolor="black";
	filltransparency=0.8;
	x1space="datavalue";
	y1space="wallpercent";
	function="polygon ";
	infile "https://fred.stlouisfed.org/graph/fredgraph.csv?id=usrecm" url firstobs=2 dsd truncover;
	input x1 yymmdd10. +1 v;
	if v then do;
		y1=0;
		output;
		function="polycont";
		y1+100;
		output;
		x1=intnx("month",x1,1);
		output;
		y1+-100;
		output;
	end;
run;

ods html close;
ods results=off;
ods listing gpath="!userprofile\desktop\";
ods graphics/reset;

proc sgplot data=have sganno=sganno;
	by notsorted id;
	series x=date y=value;
	xaxis valuesformat=year4.;
	yaxis valuesformat=best8. type=log;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I cannot simply adjust the SGANNO data set. How can I avoid the overwhelming SGANNO shades automatically?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot8.png" style="width: 240px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50219iBA2BC582B1447752/image-size/small?v=v2&amp;amp;px=200" role="button" title="SGPlot8.png" alt="SGPlot8.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot4.png" style="width: 240px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50215iBF66B1A4FC0416CC/image-size/small?v=v2&amp;amp;px=200" role="button" title="SGPlot4.png" alt="SGPlot4.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot7.png" style="width: 240px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50218i2425E568A54A867E/image-size/small?v=v2&amp;amp;px=200" role="button" title="SGPlot7.png" alt="SGPlot7.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot6.png" style="width: 240px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50217iC5DE0D15ACD2E7FA/image-size/small?v=v2&amp;amp;px=200" role="button" title="SGPlot6.png" alt="SGPlot6.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot5.png" style="width: 240px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50216i777A25FA7DDEE765/image-size/small?v=v2&amp;amp;px=200" role="button" title="SGPlot5.png" alt="SGPlot5.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot2.png" style="width: 240px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50213i88F42220130D2919/image-size/small?v=v2&amp;amp;px=200" role="button" title="SGPlot2.png" alt="SGPlot2.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot3.png" style="width: 240px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50214iDD2093BB260D061D/image-size/small?v=v2&amp;amp;px=200" role="button" title="SGPlot3.png" alt="SGPlot3.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot1.png" style="width: 240px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50212iE77B24663C99E587/image-size/small?v=v2&amp;amp;px=200" role="button" title="SGPlot1.png" alt="SGPlot1.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot.png" style="width: 240px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50211iD37B84A049F4E0C6/image-size/small?v=v2&amp;amp;px=200" role="button" title="SGPlot.png" alt="SGPlot.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Original: This MWE draws a shaded SGPLOT SERIES.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data data;
do t=1 to 100;
x+rannor(1);
output;
end;
run;

data sganno;
display="fill";
fillcolor="black";
filltransparency=0.8;
x1space="datavalue";
y1space="wallpercent";
do x1=-10 to 90 by 10;
function="polygon ";
y1=0;
output;
function="polycont";
y1=100;
output;
x1+10;
output;
y1=0;
output;
end;
run;

ods html close;
ods results=off;
ods listing gpath="!userprofile\desktop\";
ods graphics/reset imagename="sgplot";

proc sgplot data=data sganno=sganno;
	series x=t y=x;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;SGANNO has six uniform shades starting at X1=-10, 10, 30, 50, 70, 90, so SGPLOT locates the first shade outside the box.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sgplot.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50174iEBF1AB6D5708F08F/image-size/large?v=v2&amp;amp;px=999" role="button" title="sgplot.png" alt="sgplot.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I have manually used PROC SGPLOT DATA=DATA SGANNO=SGANNO(WHERE=(X1&amp;gt;=0)); to avoid this, but this requires too many micromanagements. How can I automatically limit SGANNO not to overwhelm the box?&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 13:45:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/688969#M20549</guid>
      <dc:creator>Junyong</dc:creator>
      <dc:date>2020-10-06T13:45:07Z</dc:date>
    </item>
    <item>
      <title>Re: SGANNO Overwhelms SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/688973#M20550</link>
      <description>Is there a particular reason to implement this using SGANNO?&lt;BR /&gt;&lt;BR /&gt;Try using a Band or Polygon statement instead?&lt;BR /&gt;Or possibly even the colorbands option on the xaxis/yaxis statement? I feel like those would align better if your data changes..</description>
      <pubDate>Mon, 05 Oct 2020 19:22:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/688973#M20550</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-10-05T19:22:03Z</dc:date>
    </item>
    <item>
      <title>Re: SGANNO Overwhelms SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/688980#M20551</link>
      <description>&lt;P&gt;No specific reason—I have been using SGANNO just following&amp;nbsp;&lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2019/02/08/how-to-show-recessions-on-your-sgplot-line-graph/" target="_blank"&gt;How to show recessions on your SGplot line graph&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2020 19:26:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/688980#M20551</guid>
      <dc:creator>Junyong</dc:creator>
      <dc:date>2020-10-05T19:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: SGANNO Overwhelms SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/688986#M20552</link>
      <description>Well, annotation allows you to control your features but that means you lose some of the automatic options. More control means you have to specify the details....I'd suggest switching to a different approach that was more dynamic if you need to do it more than just as a single post. &lt;BR /&gt;&lt;BR /&gt;I've moved the post to the Graphics forum, perhaps one of the SAS graphing guru's may have a better answer for you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Mon, 05 Oct 2020 19:31:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/688986#M20552</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-10-05T19:31:24Z</dc:date>
    </item>
    <item>
      <title>Re: SGANNO Overwhelms SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/688997#M20554</link>
      <description>&lt;P&gt;I think the BLOCK plot will work for what you're trying to do.&amp;nbsp; I used your value of t to make a modular variable (1 or 0).&amp;nbsp; I use this to make different blocks in the block plot, then alternate between black and white for the two colors.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sgplot.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50183iF6D6613A5BAD79FC/image-size/large?v=v2&amp;amp;px=999" role="button" title="sgplot.png" alt="sgplot.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data data;
do t=1 to 100;
x+rannor(1);
block=mod(floor(t/10),2);
output;
end;
run;


ods results;
ods graphics/reset imagename="sgplot";

proc sgplot data=data;
block x=t block=block / nooutline filltype=alternate
    fillattrs=(color=white) altfillattrs=(color=black transparency=0.8)
   nolabel novalues;
	series x=t y=x;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Oct 2020 20:00:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/688997#M20554</guid>
      <dc:creator>JeffMeyers</dc:creator>
      <dc:date>2020-10-05T20:00:39Z</dc:date>
    </item>
    <item>
      <title>Re: SGANNO Overwhelms SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/689003#M20555</link>
      <description>&lt;P&gt;Adding two macro variables could provide some automation:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data data;
do t=1 to 100;
x+rannor(1);
output;
end;
run;

proc sql;
select 10*floor(min(t)/10), 10*ceil(max(t)/10) into :t0, :t1
from data;
quit;

data sganno;
display="fill";
fillcolor="black";
filltransparency=0.8;
x1space="datavalue";
y1space="wallpercent";
do x1=&amp;amp;t0 to &amp;amp;t1-10 by 10;
function="polygon ";
y1=0;
output;
function="polycont";
y1=100;
output;
x1+10;
output;
y1=0;
output;
end;
run;

proc sgplot data=data sganno=sganno;
    series x=t y=x;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 648px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50184iBC931B032BD98416/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Oct 2020 20:50:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/689003#M20555</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2020-10-05T20:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: SGANNO Overwhelms SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/689006#M20556</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15130"&gt;@DanH_sas&lt;/a&gt; Not to hijack this thread, but is there a reason why there's no Y-axis variant of block plot?  I've actually wanted something like that quite a few times.</description>
      <pubDate>Mon, 05 Oct 2020 21:16:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/689006#M20556</guid>
      <dc:creator>JeffMeyers</dc:creator>
      <dc:date>2020-10-05T21:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: SGANNO Overwhelms SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/689046#M20557</link>
      <description>&lt;P&gt;Why are you starting your x1 values for the annotated shaded bars at -10?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;do x1=-10 to 90 by 10;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Since your x axis starts at 0, then the -10 is going to be outside the axes. If you start at 0 or 10, I think you will get something more of what you're looking for!&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 00:29:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/689046#M20557</guid>
      <dc:creator>GraphGuy</dc:creator>
      <dc:date>2020-10-06T00:29:25Z</dc:date>
    </item>
    <item>
      <title>Re: SGANNO Overwhelms SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/689200#M20558</link>
      <description>&lt;P&gt;That was just an MWE. My real data are more similar to this.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	input id :$16. @@;
	f=compress("https://fred.stlouisfed.org/graph/fredgraph.csv?id="||id);
	infile _ url filevar=f firstobs=2 dsd truncover end=e;
	do until(e);
		input date yymmdd10. +1 value;
		if value&amp;gt;. then output;
	end;
cards;
will5000indfc indpro sp500 unrate dexuseu cpiaucsl gdp dgs10 fedfunds
;

data sganno(drop=v);
	display="fill";
	fillcolor="black";
	filltransparency=0.8;
	x1space="datavalue";
	y1space="wallpercent";
	function="polygon ";
	infile "https://fred.stlouisfed.org/graph/fredgraph.csv?id=usrecm" url firstobs=2 dsd truncover;
	input x1 yymmdd10. +1 v;
	if v then do;
		y1=0;
		output;
		function="polycont";
		y1+100;
		output;
		x1=intnx("month",x1,1);
		output;
		y1+-100;
		output;
	end;
run;

ods html close;
ods results=off;
ods listing gpath="!userprofile\desktop\";
ods graphics/reset;

proc sgplot data=have sganno=sganno;
	by notsorted id;
	series x=date y=value;
	xaxis valuesformat=year4.;
	yaxis valuesformat=best8. type=log;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have multiple time series to plot with one SGANNO data set shared by the time series. That is why I cannot simply adjust X1 for each.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot.png" style="width: 240px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50211iD37B84A049F4E0C6/image-size/small?v=v2&amp;amp;px=200" role="button" title="SGPlot.png" alt="SGPlot.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot1.png" style="width: 240px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50212iE77B24663C99E587/image-size/small?v=v2&amp;amp;px=200" role="button" title="SGPlot1.png" alt="SGPlot1.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot2.png" style="width: 240px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50213i88F42220130D2919/image-size/small?v=v2&amp;amp;px=200" role="button" title="SGPlot2.png" alt="SGPlot2.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot3.png" style="width: 240px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50214iDD2093BB260D061D/image-size/small?v=v2&amp;amp;px=200" role="button" title="SGPlot3.png" alt="SGPlot3.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot4.png" style="width: 240px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50215iBF66B1A4FC0416CC/image-size/small?v=v2&amp;amp;px=200" role="button" title="SGPlot4.png" alt="SGPlot4.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot5.png" style="width: 240px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50216i777A25FA7DDEE765/image-size/small?v=v2&amp;amp;px=200" role="button" title="SGPlot5.png" alt="SGPlot5.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot6.png" style="width: 240px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50217iC5DE0D15ACD2E7FA/image-size/small?v=v2&amp;amp;px=200" role="button" title="SGPlot6.png" alt="SGPlot6.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot7.png" style="width: 240px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50218i2425E568A54A867E/image-size/small?v=v2&amp;amp;px=200" role="button" title="SGPlot7.png" alt="SGPlot7.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot8.png" style="width: 240px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50219iBA2BC582B1447752/image-size/small?v=v2&amp;amp;px=200" role="button" title="SGPlot8.png" alt="SGPlot8.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hope this better explains.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 13:33:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/689200#M20558</guid>
      <dc:creator>Junyong</dc:creator>
      <dc:date>2020-10-06T13:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: SGANNO Overwhelms SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/689203#M20559</link>
      <description>&lt;P&gt;The original code was just an MWE. I know that I can change the SGANNO data set to plot properly but, as described below, wondered if SGPLOT has an automatic solution to avoid the overwhelming shades.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 13:35:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/689203#M20559</guid>
      <dc:creator>Junyong</dc:creator>
      <dc:date>2020-10-06T13:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: SGANNO Overwhelms SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/689222#M20560</link>
      <description>&lt;P&gt;I'm a bit confused by what you're trying to do.&amp;nbsp; Do you want the shading to alternate along a specific length of time, or just every 10% of the graph?&lt;BR /&gt;&lt;BR /&gt;If it's by a specific length of time then my solution would work.&amp;nbsp; If it's by 10% of the graph then you would want to annotate by wall percent instead of by data value on your x-axis.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 14:30:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/689222#M20560</guid>
      <dc:creator>JeffMeyers</dc:creator>
      <dc:date>2020-10-06T14:30:26Z</dc:date>
    </item>
    <item>
      <title>Re: SGANNO Overwhelms SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/689243#M20561</link>
      <description>&lt;P&gt;I am not randomly shading 10% of each graph. &lt;A href="https://fred.stlouisfed.org/series/USRECM" target="_blank" rel="noopener"&gt;NBER based Recession Indicators for the United States from the Peak through the Trough&lt;/A&gt; is a dummy time series that is 1 if the market is in recession.&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://fred.stlouisfed.org/graph/fredgraph.png?g=wtdk" border="0" /&gt;&lt;/P&gt;&lt;P&gt;This monthly series is from December 1854 to September 2020, and I am shading the plots of other multiple time series variables such as &lt;A href="https://fred.stlouisfed.org/series/INDPRO" target="_blank" rel="noopener"&gt;Industrial Production: Total Index&lt;/A&gt;&amp;nbsp;(from January 1919) and &lt;A href="https://fred.stlouisfed.org/series/UNRATE" target="_blank" rel="noopener"&gt;Unemployment Rate&lt;/A&gt;&amp;nbsp;(from January 1948) as follows.&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://fred.stlouisfed.org/graph/fredgraph.png?g=wm5L" border="0" /&gt;&lt;/P&gt;&lt;P&gt;The problem is that the time series variables I am plotting start later (for example, January 1919) than the recession series (December 1854) I am shading, and the SGPLOT SGANNO unexpectedly spans the ranges outside the plotting area. I don't want to apply the shades outside the box of the time series plots.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot3.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50214iDD2093BB260D061D/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPlot3.png" alt="SGPlot3.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This is the same Unemployment Rate series drawn by SGPLOT. The SGANNO shades 1937, 1938, and 1945 because the market was in recession, but the Unemployment Rate series starts in January 1948, so the two pre-1948 shades are making the outcome ugly.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 15:28:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/689243#M20561</guid>
      <dc:creator>Junyong</dc:creator>
      <dc:date>2020-10-06T15:28:19Z</dc:date>
    </item>
    <item>
      <title>Re: SGANNO Overwhelms SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/689252#M20562</link>
      <description>&lt;P&gt;I would then suggest looking at my earlier example using the BLOCK plot.&amp;nbsp; If you have or can calculate a variable that is equal to 1 whenever you want it shaded and can make it 0 when you don't want it shaded, you can use the BLOCK plot to alternate the shading like in my example.&amp;nbsp; Then SGPLOT would automatically limit where the shading happens (it won't draw it outside the axes like annotation does).&amp;nbsp; I don't have your exact data to give a more specific example.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 15:43:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/689252#M20562</guid>
      <dc:creator>JeffMeyers</dc:creator>
      <dc:date>2020-10-06T15:43:59Z</dc:date>
    </item>
    <item>
      <title>Re: SGANNO Overwhelms SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/689255#M20563</link>
      <description>If you do the bands manually, which is what annotation is, then you need to manually ensure they fit within the graphic plotting area. There are valid use cases for having annotations outside of the main graph area so that isn't a limitation within the annotation - there may or may not be an option that supports it. But to have a dynamic solution you either can ensure your data is within the bounds  (macro?) or you need to use a different approach, like blockplot, as previously suggested. &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 06 Oct 2020 15:48:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/689255#M20563</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-10-06T15:48:29Z</dc:date>
    </item>
    <item>
      <title>Re: SGANNO Overwhelms SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/689292#M20564</link>
      <description>&lt;P&gt;So the corresponding MWE will be this.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
	n=_n_;
	input id :$16. @@;
	f=compress("https://fred.stlouisfed.org/graph/fredgraph.csv?id="||id);
	infile _ url filevar=f firstobs=2 dsd truncover end=e;
	do until(e);
		input date yymmdd10. +1 value;
		if value&amp;gt;. then output;
	end;
	format date yymmdd10.;
cards;
will5000indfc indpro sp500 unrate dexuseu cpiaucsl gdp dgs10 fedfunds usrecm
;

proc sql;
	create table want(drop=n) as
		select i.*,j.value as usrecm
		from have(where=(id^="usrecm")) i
			left join have(where=(id="usrecm")) j
				on put(i.date,yymm.)=put(j.date,yymm.)
		order by i.n,date;
quit;

ods html close;
ods results=off;
ods listing gpath="!userprofile\desktop\";
ods graphics/reset;

proc sgplot;
	by notsorted id;
	series x=date y=value;
	block x=date block=usrecm/nooutline filltype=alternate fillattrs=(transparency=1) altfillattrs=(color=black transparency=0.8) nolabel;
	xaxis valuesformat=year4. values=("1jan1901"d to "31dec2100"d by year10) valueshint;
	yaxis valuesformat=best8. type=log;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I saw the BLOCK statement for the first time because I have been shading using SGANNO following &lt;A href="https://blogs.sas.com/content/graphicallyspeaking/2019/02/08/how-to-show-recessions-on-your-sgplot-line-graph/" target="_blank"&gt;How to show recessions on your SGplot line graph&lt;/A&gt; as aforementioned. It seems this is simpler. But may I ask two more questions?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot1.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50225iB05595CD4BA4F838/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPlot1.png" alt="SGPlot1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;1. The BLOCK FILLATTRS ALTFILLATTRS results depend on the first value of the dummy variable for BLOCK. For example, the shading outcome is reversed here because the dummy variable value at the starting point of the series is 1 here. How can I correct this?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot.png" style="width: 640px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50228i4642C9030F697905/image-size/large?v=v2&amp;amp;px=999" role="button" title="SGPlot.png" alt="SGPlot.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;2. I often use multiple shading colors and their orders are not always consistent (for example, white-red-green-red-white-red-green, etc.). Can I use this BLOCK solution for this case too?&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 18:05:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/689292#M20564</guid>
      <dc:creator>Junyong</dc:creator>
      <dc:date>2020-10-06T18:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: SGANNO Overwhelms SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/689293#M20565</link>
      <description>&lt;P&gt;1. Use the FILLATTRS and ALTFILLATTRS options to reverse the color assignments in that case.&lt;/P&gt;
&lt;P&gt;2. Use FILLTYPE=MULTICOLOR to switch to multicolor mode, and use the DATACOLORS option on the STYLEATTRS statement to control the colors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope the helps!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 18:13:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/689293#M20565</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2020-10-06T18:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: SGANNO Overwhelms SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/689296#M20566</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/2153"&gt;@JeffMeyers&lt;/a&gt;&amp;nbsp;, we have not had a lot of call for it. There are workarounds (using Band plots, etc.); but, if you need this support, I would suggest putting in a request with Technical Support so that we can track it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 18:17:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/689296#M20566</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2020-10-06T18:17:11Z</dc:date>
    </item>
    <item>
      <title>Re: SGANNO Overwhelms SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/689303#M20567</link>
      <description>&lt;P&gt;As in the MWE, I am plotting these series with the BY statement. I need to reverse not all but only the problematic results.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot1.png" style="width: 240px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50230iEAC09BDECE7058C5/image-size/small?v=v2&amp;amp;px=200" role="button" title="SGPlot1.png" alt="SGPlot1.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot3.png" style="width: 240px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50231iF0F94F93C04BFCD9/image-size/small?v=v2&amp;amp;px=200" role="button" title="SGPlot3.png" alt="SGPlot3.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SGPlot5.png" style="width: 240px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/50232iC9C5D24A1444466E/image-size/small?v=v2&amp;amp;px=200" role="button" title="SGPlot5.png" alt="SGPlot5.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;It seems I need MULTICOLOR anyway to respectively assign specific colors to specific values.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 18:24:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/689303#M20567</guid>
      <dc:creator>Junyong</dc:creator>
      <dc:date>2020-10-06T18:24:51Z</dc:date>
    </item>
    <item>
      <title>Re: SGANNO Overwhelms SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/689304#M20568</link>
      <description>&lt;P&gt;If you want to assign specific colors to specific BLOCK values, use an ATTRIBUTES MAP with the FILLTYPE=MULTICOLOR setting. That way, the correct colors will be used regardless of data order.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Oct 2020 18:32:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGANNO-Overwhelms-SGPLOT/m-p/689304#M20568</guid>
      <dc:creator>DanH_sas</dc:creator>
      <dc:date>2020-10-06T18:32:01Z</dc:date>
    </item>
  </channel>
</rss>

