<?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 Location of REFLINE label in PROC SGPANEL in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Location-of-REFLINE-label-in-PROC-SGPANEL/m-p/934057#M24737</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to know if it is possible to position REFLINE label outside of plot area in PROC SGPANEL. Based on SAS documentation it seems only possible in PROC SGPLOT, where &lt;STRONG&gt;labelloc&lt;/STRONG&gt; option can be defined.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See following example:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Richard5_1-1719581975581.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/97968i122D7AAC60261266/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Richard5_1-1719581975581.png" alt="Richard5_1-1719581975581.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Richard5_2-1719581988520.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/97969i0C8715BF3FE35480/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Richard5_2-1719581988520.png" alt="Richard5_2-1719581988520.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;/* create rudimentary dataset */
data have(drop=i);
call streaminit(123);
format Date date9.;
do i=0 to 24;
	do Country=1 to 3;
		do Category=1 to 4;
			Date=intnx('month','31dec2020'd,i,'end');
			n=rand('normal',100,5);
			output;
		end;
	end;
end;
run;

/* SGPANEL with REFLINE labels inside the plot area */
ods graphics / width=600 height=300;
proc sgpanel data=have pctlevel=group;
panelby Country / columns=3;
vbar Date / response=n group=Category stat=percent;
colaxis type=time;
refline '30jun2021'd / axis=x label='REF 1' label;
refline '31dec2021'd / axis=x label='REF 2';
run;

/* SGPLOT with REFLINE labels outside the plot area */
proc sgplot data=have(where=(country=1)) pctlevel=group;
vbar Date / response=n group=Category stat=percent;
xaxis type=time;
refline '30jun2021'd / axis=x label='REF 1' labelloc=outside;
refline '31dec2021'd / axis=x label='REF 2' labelloc=outside;
run;
ods graphics / reset;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;P.S. of course, I can do loop and instead of PROC SGPANEL do multiple PROC SGPLOTs, but that is not my question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any help,&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;</description>
    <pubDate>Fri, 28 Jun 2024 13:49:27 GMT</pubDate>
    <dc:creator>Richard5</dc:creator>
    <dc:date>2024-06-28T13:49:27Z</dc:date>
    <item>
      <title>Location of REFLINE label in PROC SGPANEL</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Location-of-REFLINE-label-in-PROC-SGPANEL/m-p/934057#M24737</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to know if it is possible to position REFLINE label outside of plot area in PROC SGPANEL. Based on SAS documentation it seems only possible in PROC SGPLOT, where &lt;STRONG&gt;labelloc&lt;/STRONG&gt; option can be defined.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See following example:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Richard5_1-1719581975581.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/97968i122D7AAC60261266/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Richard5_1-1719581975581.png" alt="Richard5_1-1719581975581.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Richard5_2-1719581988520.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/97969i0C8715BF3FE35480/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Richard5_2-1719581988520.png" alt="Richard5_2-1719581988520.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;/* create rudimentary dataset */
data have(drop=i);
call streaminit(123);
format Date date9.;
do i=0 to 24;
	do Country=1 to 3;
		do Category=1 to 4;
			Date=intnx('month','31dec2020'd,i,'end');
			n=rand('normal',100,5);
			output;
		end;
	end;
end;
run;

/* SGPANEL with REFLINE labels inside the plot area */
ods graphics / width=600 height=300;
proc sgpanel data=have pctlevel=group;
panelby Country / columns=3;
vbar Date / response=n group=Category stat=percent;
colaxis type=time;
refline '30jun2021'd / axis=x label='REF 1' label;
refline '31dec2021'd / axis=x label='REF 2';
run;

/* SGPLOT with REFLINE labels outside the plot area */
proc sgplot data=have(where=(country=1)) pctlevel=group;
vbar Date / response=n group=Category stat=percent;
xaxis type=time;
refline '30jun2021'd / axis=x label='REF 1' labelloc=outside;
refline '31dec2021'd / axis=x label='REF 2' labelloc=outside;
run;
ods graphics / reset;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;P.S. of course, I can do loop and instead of PROC SGPANEL do multiple PROC SGPLOTs, but that is not my question.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any help,&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2024 13:49:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Location-of-REFLINE-label-in-PROC-SGPANEL/m-p/934057#M24737</guid>
      <dc:creator>Richard5</dc:creator>
      <dc:date>2024-06-28T13:49:27Z</dc:date>
    </item>
    <item>
      <title>Re: Location of REFLINE label in PROC SGPANEL</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Location-of-REFLINE-label-in-PROC-SGPANEL/m-p/934064#M24738</link>
      <description>&lt;P&gt;No, it isn't possible. The &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/grstatproc/n0pwosq79e334dn1bdupnyvhrhok.htm" target="_self"&gt;documentation for the REFLINE statement in PROC SGPANEL&lt;/A&gt;&amp;nbsp;shows that the only option for the label is the LABELPOS= option, which controls whether the label is on the left/right or bottom/top. There is not an option to put the label outside the plot area.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Think about a 3x3 panel, there isn't really an "outside" region for the middle plot. Similarly, plots along the first column don't have an "outside-right" region.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just to be sure, I checked &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_051/grstatgraph/p03jtr6n56wu4ln1k77szqw1fjkc.htm#p0n3jzlwb8z1iln1tm8ll41nq953" target="_self"&gt;the doc for the REFERENCELINE statement in the GTL&lt;/A&gt;, which is the underlying source for the REFLINE statements in PROC SGPANEL. Although there is a CURVELABELLOCATION= option, the doc states the the option is not available for paneled plots:&lt;/P&gt;
&lt;TABLE class="xisDoc-summary"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TH class="xisDoc-restriction"&gt;Restriction&lt;/TH&gt;
&lt;TD class="xisDoc-summaryText"&gt;OUTSIDE cannot be used when the REFERENCELINE is used in multicell layouts such as LATTICE, DATAPANEL, or DATALATTICE, where axes might be external to the grid.&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2024 13:59:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Location-of-REFLINE-label-in-PROC-SGPANEL/m-p/934064#M24738</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2024-06-28T13:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: Location of REFLINE label in PROC SGPANEL</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Location-of-REFLINE-label-in-PROC-SGPANEL/m-p/934066#M24739</link>
      <description>Alright, thank you!</description>
      <pubDate>Fri, 28 Jun 2024 14:11:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Location-of-REFLINE-label-in-PROC-SGPANEL/m-p/934066#M24739</guid>
      <dc:creator>Richard5</dc:creator>
      <dc:date>2024-06-28T14:11:44Z</dc:date>
    </item>
    <item>
      <title>Re: Location of REFLINE label in PROC SGPANEL</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Location-of-REFLINE-label-in-PROC-SGPANEL/m-p/934160#M24740</link>
      <description>&lt;P&gt;You could make more OFFSET at Y axis top to display this label.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods graphics / width=600 height=300;
proc sgpanel data=have pctlevel=group;
panelby Country / columns=3;
vbar Date / response=n group=Category stat=percent;
colaxis type=time;
rowaxis offsetmax=0.1;
refline '30jun2021'd / axis=x label='REF 1' label;
refline '31dec2021'd / axis=x label='REF 2';
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1719650303414.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/98019i105AB66AA7277792/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1719650303414.png" alt="Ksharp_0-1719650303414.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 29 Jun 2024 08:38:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Location-of-REFLINE-label-in-PROC-SGPANEL/m-p/934160#M24740</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-06-29T08:38:42Z</dc:date>
    </item>
  </channel>
</rss>

