<?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: Mixing referentials in SGANNO in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Mixing-referentials-in-SGANNO/m-p/939774#M24947</link>
    <description>&lt;P&gt;Solution: I answered my own question and&amp;nbsp; contacted tech support for them to create a defect entry, or at least generate a usage note describing this absurd behaviour.&lt;/P&gt;</description>
    <pubDate>Sun, 18 Aug 2024 08:50:36 GMT</pubDate>
    <dc:creator>ChrisNZ</dc:creator>
    <dc:date>2024-08-18T08:50:36Z</dc:date>
    <item>
      <title>Mixing referentials in SGANNO</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Mixing-referentials-in-SGANNO/m-p/939371#M24927</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Running this code&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data T;
  retain X1SPACE X2SPACE 'datavalue' Y1SPACE Y2SPACE 'datapercent' FUNCTION 'line';
  X1=13; X2=15; Y1=25; Y2=50; output;
  X1=11; X2=13; Y1SPACE ='datavalue'; Y2SPACE ='datavalue'; YC1='Alice'; YC2='Alice'; output;
run;  
proc sgplot data=SASHELP.CLASS sganno=T; 
  scatter x=AGE y=NAME;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV id="sasLogWarning1_1723701886502" class="sasWarning"&gt;results in only one line being drawn, and message:&lt;/DIV&gt;
&lt;DIV class="sasWarning"&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;WARNING: DrawLine statement has missing/invalid value for position (X or Y). Draw statement discarded.&lt;/CODE&gt;&lt;/P&gt;
&lt;/DIV&gt;
&lt;DIV class="sasWarning"&gt;Removing any one of the 2&amp;nbsp;&lt;CODE class=" language-sas"&gt;output&lt;/CODE&gt; lines in the data step results in the remaining line being drawn without issue.&lt;/DIV&gt;
&lt;DIV class="sasWarning"&gt;How can I mix referentials (or drawspaces) using SGANNO and draw these 2 lines?&lt;/DIV&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2024 06:16:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Mixing-referentials-in-SGANNO/m-p/939371#M24927</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2024-08-15T06:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: Mixing referentials in SGANNO</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Mixing-referentials-in-SGANNO/m-p/939372#M24928</link>
      <description>&lt;P&gt;I answered my own question.&lt;/P&gt;
&lt;P&gt;I need to set Y1 and Y2 to missing before Y1C and Y2C are used.&lt;/P&gt;
&lt;P&gt;Why oh why?&lt;/P&gt;
&lt;P&gt;When space is &lt;CODE&gt;datavalue&lt;/CODE&gt;&amp;nbsp; and the variable is character, why does SAS try to read Y1 and Y2 instead of Y1C and Y2C? And then throw a fit is that value is not missing?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Aug 2024 06:21:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Mixing-referentials-in-SGANNO/m-p/939372#M24928</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2024-08-15T06:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: Mixing referentials in SGANNO</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Mixing-referentials-in-SGANNO/m-p/939383#M24930</link>
      <description>&lt;P&gt;In situations that involve switching drawing spaces, you might want to consider using the %SGANNO macros:&amp;nbsp;&lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/v_051/grstatproc/p0y4ncx97x7cd9n1w3ovmb2hixs2.htm" target="_blank"&gt;SAS Help Center: SG Annotation Function Dictionary&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;The macros include a RESET="ALL" option, which clears values left over from other calls. For example, your program can be rewritten by using the %SGLINE macro, as follows:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%SGANNO
data T2;
%sgline(x1space='datavalue',
        x2space='datavalue',
        y1space='datapercent',
        y2space='datapercent',
        X1=13, X2=15, Y1=25, Y2=50); 
%sgline(drawspace='datavalue',
        X1=11, X2=13, YC1='Alice', YC2='Alice',
        reset="all"); 
run;

proc sgplot data=SASHELP.CLASS sganno=T2; 
  scatter x=AGE y=NAME;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 15 Aug 2024 09:27:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Mixing-referentials-in-SGANNO/m-p/939383#M24930</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2024-08-15T09:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: Mixing referentials in SGANNO</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Mixing-referentials-in-SGANNO/m-p/939715#M24944</link>
      <description>&lt;P&gt;The &lt;CODE class=" language-sas"&gt;%sganno&lt;/CODE&gt; macros present no interest to me. Among the reasons:&lt;/P&gt;
&lt;P&gt;1. It's not easier to write&lt;/P&gt;
&lt;PRE&gt;%sgtext( X1=50, Y1=50, LABEL='Player on court');&lt;/PRE&gt;
&lt;P&gt;than&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;X1=50; Y1=50; LABEL='Player on court';&amp;nbsp;output;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;2. You need to rewrite everything each time, you can't set a variable to use for several annotations like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;X1=50;
%sgtext( Y1=50, LABEL='Player on court'); * DOES NOT WORK;
%sgtext( Y1=75, LABEL='Missed shots');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;3. The macros break working code. If you try to mix &lt;CODE class=" language-sas"&gt;%sganno&lt;/CODE&gt; and regular &lt;CODE class=" language-sas"&gt;output&lt;/CODE&gt;, you quickly run into trouble.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ANNO;
  FUNCTION='text'; X1=50; Y1=50; LABEL='On-court'; output;
  FUNCTION='line'; X1=25; X2=75; Y1=80;  Y2=Y1; output;
run;  &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;works but&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ANNO;
 %sgtext( X1=50, Y1=50, LABEL='On-court');
 FUNCTION='line'; X1=25; X2=75; Y1=80;  Y2=Y1; output;
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;generates&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;WARNING: The LINE function is missing required column. The function will be ignored.&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;which is NOT a helpful message.&lt;/P&gt;
&lt;P&gt;The coded columns are exactly the same.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;All in all, not worth the trouble. The plethora of variable names compared to &lt;CODE class=" language-sas"&gt;%anno&lt;/CODE&gt; are painful enough, no need to add more pain.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2024 08:49:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Mixing-referentials-in-SGANNO/m-p/939715#M24944</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2024-08-18T08:49:45Z</dc:date>
    </item>
    <item>
      <title>Re: Mixing referentials in SGANNO</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Mixing-referentials-in-SGANNO/m-p/939774#M24947</link>
      <description>&lt;P&gt;Solution: I answered my own question and&amp;nbsp; contacted tech support for them to create a defect entry, or at least generate a usage note describing this absurd behaviour.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2024 08:50:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Mixing-referentials-in-SGANNO/m-p/939774#M24947</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2024-08-18T08:50:36Z</dc:date>
    </item>
    <item>
      <title>Re: Mixing referentials in SGANNO</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Mixing-referentials-in-SGANNO/m-p/940050#M24962</link>
      <description>&lt;P&gt;Fyi a defect has been raised. Hopefully his gets fixed.&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;I've reported this problem to development for fixing in a future release. Until that time, you'll need to use your circumvention of setting the Y1/Y2 values to missing.  &lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2024 04:40:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Mixing-referentials-in-SGANNO/m-p/940050#M24962</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2024-08-20T04:40:57Z</dc:date>
    </item>
  </channel>
</rss>

