<?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: Simple Annotation on Proc Boxplot in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Simple-Annotation-on-Proc-Boxplot/m-p/324759#M11387</link>
    <description>&lt;P&gt;Hmm... Size=5; didn't change anything. How do I post my goptions? I ran proc goptions;run; and lots of text was outputted into my log. I wouldn't dare post all that here.&lt;/P&gt;</description>
    <pubDate>Fri, 13 Jan 2017 23:22:32 GMT</pubDate>
    <dc:creator>pkfamily</dc:creator>
    <dc:date>2017-01-13T23:22:32Z</dc:date>
    <item>
      <title>Simple Annotation on Proc Boxplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Simple-Annotation-on-Proc-Boxplot/m-p/324451#M11369</link>
      <description>&lt;P&gt;Please offer me your assistance O' great internet SAS lords. My ultimate goal is to annotate the number of observations by group on a box plot. However, I am stuck for I can not even get a simple annotation to appear on my plot! My code is below along with the outputted plot.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data testplot;
 do i=1 to 10;
  grp=i;
  time=5; 
  output;
 end;
run;

data test_anno;
 length function $8;
 retain xsys ysys "2" hsys "3" function "label" size 1;
 x=5; y=5; text="testing";output;
 run;

proc boxplot data=testplot;
plot time*grp/horizontal annotate=test_anno;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/6690iA12D75C5CCA3EE5E/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="tempgraph.png" title="tempgraph.png" width="536" height="398" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2017 01:32:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Simple-Annotation-on-Proc-Boxplot/m-p/324451#M11369</guid>
      <dc:creator>pkfamily</dc:creator>
      <dc:date>2017-01-13T01:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Annotation on Proc Boxplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Simple-Annotation-on-Proc-Boxplot/m-p/324536#M11370</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't have a solution for you but I can see the annotate seems to be incomplete.&lt;/P&gt;
&lt;P&gt;I found 2 samples for you from &lt;A href="http://robslink.com/SAS/Home.htm" target="_self"&gt;Robert Allison's SAS/Graph Examples!&lt;/A&gt;&amp;nbsp;page where the Boxplot procedure is used with an annotate:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;A href="http://robslink.com/SAS/democd29/mpgplot.sas" target="_self"&gt;http://robslink.com/SAS/democd29/mpgplot.sas&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;A href="http://robslink.com/SAS/democd22/tele_gif.sas" target="_self"&gt;http://robslink.com/SAS/democd22/tele_gif.sas&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope that helps you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cheers,&lt;/P&gt;
&lt;P&gt;Damo&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2017 12:16:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Simple-Annotation-on-Proc-Boxplot/m-p/324536#M11370</guid>
      <dc:creator>Damo</dc:creator>
      <dc:date>2017-01-13T12:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Annotation on Proc Boxplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Simple-Annotation-on-Proc-Boxplot/m-p/324539#M11371</link>
      <description>&lt;P&gt;Customizing BoxPlots is a lot easier with SGPLOT procedure. &amp;nbsp;There are many examples in &lt;A href="http://blogs.sas.com/content/graphicallyspeaking/?s=box" target="_blank"&gt;Graphically Speaking&lt;/A&gt;&amp;nbsp;blog. &amp;nbsp;Here is one of &lt;A href="http://blogs.sas.com/content/graphicallyspeaking/2015/12/23/box-plot-with-stat-table-and-markers/" target="_blank"&gt;Box with added Stat Table&lt;/A&gt;. &amp;nbsp;Annotation may not be required based on the release level of SAS you have.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2017 12:52:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Simple-Annotation-on-Proc-Boxplot/m-p/324539#M11371</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2017-01-13T12:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Annotation on Proc Boxplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Simple-Annotation-on-Proc-Boxplot/m-p/324683#M11382</link>
      <description>&lt;P&gt;Thanks! Doesn't solve my original question but sure does solve my overall problem. Haha... linking back to your own article I see. How ingenious of you. The code below adds the number of observations next to each group. Oh and if you were like me and the graph failed to output due to the maximum allotted&amp;nbsp;space for JAVA, you can increase the space by editing the SAS config file. More specifically, changing &amp;nbsp;-xmx128m and -xms128m to a higher number.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods output sgplot=sgplotdata;
proc sgplot data=testplot;
hbox time/category=grp;
run;

data sdata;
set sgplotdata;
where BOX_TIME_X_GRP_SORTORDER_Inte__Y ne . and
BOX_TIME_X_GRP_SORTORDER_Inte_ST = 'N';
rename BOX_TIME_X_GRP_SORTORDER_Inte_ST=stat BOX_TIME_X_GRP_SORTORDER_Inte__Y=value BOX_TIME_X_GRP_SORTORDER_Inte__X=cat;
keep BOX_TIME_X_GRP_SORTORDER_Inte_ST BOX_TIME_X_GRP_SORTORDER_Inte__Y BOX_TIME_X_GRP_SORTORDER_Inte__X;
run;

data merged;
set testplot sdata;
run;

proc sgplot data=merged;
hbox time/category=grp;
yaxistable value/y=cat class=stat;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/6712i497E05BDAED6316F/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="tempgraph.png" title="tempgraph.png" width="514" height="382" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2017 20:51:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Simple-Annotation-on-Proc-Boxplot/m-p/324683#M11382</guid>
      <dc:creator>pkfamily</dc:creator>
      <dc:date>2017-01-13T20:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Annotation on Proc Boxplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Simple-Annotation-on-Proc-Boxplot/m-p/324696#M11383</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/112378"&gt;@pkfamily&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Please offer me your assistance O' great internet SAS lords. My ultimate goal is to annotate the number of observations by group on a box plot. However, I am stuck for I can not even get a simple annotation to appear on my plot! My code is below along with the outputted plot.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data testplot;
 do i=1 to 10;
  grp=i;
  time=5; 
  output;
 end;
run;

data test_anno;
 length function $8;
 retain xsys ysys "2" hsys "3" function "label" size 1;
 x=5; y=5; text="testing";output;
 run;

proc boxplot data=testplot;
plot time*grp/horizontal annotate=test_anno;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Most likely the issue is that the annotate data set does not have a WHEN variable. When controls whether the annotate data is applied before (When='B' and is the default [which I have never quite figured out the rationale for] ) or after the graph (When='A'). When drawn before then the boxplot output covers the annotation.&lt;/P&gt;
&lt;P&gt;Add When='A'; to the annotate data set and see if that fixes the Proc Boxplot issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2017 20:53:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Simple-Annotation-on-Proc-Boxplot/m-p/324696#M11383</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-01-13T20:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Annotation on Proc Boxplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Simple-Annotation-on-Proc-Boxplot/m-p/324746#M11385</link>
      <description>&lt;P&gt;Thank you so much for offering your advice! Still no good however. Here is the code I used along with printed annotate dataset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test_anno;
 length function $8;
 retain xsys ysys "2" hsys "3" function "label" size 1;
 When='A';
 x=5; y=5; text="testing";output;
 run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/6718i8C62DA9444ABCEFF/image-size/original?v=v2&amp;amp;px=-1" border="0" alt="tempgraph.png" title="tempgraph.png" /&gt;&lt;/P&gt;&lt;DIV class="branch"&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Fri, 13 Jan 2017 22:52:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Simple-Annotation-on-Proc-Boxplot/m-p/324746#M11385</guid>
      <dc:creator>pkfamily</dc:creator>
      <dc:date>2017-01-13T22:52:15Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Annotation on Proc Boxplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Simple-Annotation-on-Proc-Boxplot/m-p/324755#M11386</link>
      <description>&lt;P&gt;You don't have a unit with SIZE so defaulting to the html output it could be very small. So try SIZE=3 or 4.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Post your current GOPTIONS as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;With:&lt;/P&gt;
&lt;PRE&gt;data test_anno;
 length function $8;
 retain xsys ysys "2" hsys "3" function "label" size 5;
 x=5; y=5; when='A'; text="testing";output;
 run;

proc boxplot data=testplot;
plot time*grp/horizontal annotate=test_anno;
run;&lt;/PRE&gt;
&lt;P&gt;&lt;IMG title="boxplot5.png" alt="boxplot5.png" src="https://communities.sas.com/t5/image/serverpage/image-id/6719iAAFF3701D555AD64/image-size/original?v=v2&amp;amp;px=-1" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2017 23:14:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Simple-Annotation-on-Proc-Boxplot/m-p/324755#M11386</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2017-01-13T23:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Annotation on Proc Boxplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Simple-Annotation-on-Proc-Boxplot/m-p/324759#M11387</link>
      <description>&lt;P&gt;Hmm... Size=5; didn't change anything. How do I post my goptions? I ran proc goptions;run; and lots of text was outputted into my log. I wouldn't dare post all that here.&lt;/P&gt;</description>
      <pubDate>Fri, 13 Jan 2017 23:22:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Simple-Annotation-on-Proc-Boxplot/m-p/324759#M11387</guid>
      <dc:creator>pkfamily</dc:creator>
      <dc:date>2017-01-13T23:22:32Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Annotation on Proc Boxplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Simple-Annotation-on-Proc-Boxplot/m-p/330102#M11527</link>
      <description>&lt;P&gt;Hi.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In&lt;/P&gt;
&lt;P align="LEFT"&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;&lt;STRONG&gt;SAS/STAT&lt;/STRONG&gt;® &lt;STRONG&gt;13.1 User’s Guide&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;The BOXPLOT Procedure&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;it suggests that annotate won't work if ODS graphics is enabled.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;I just tried adding &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;ODS graphics off;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt; before your code, and the annotate seemed to work.&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;(and the plot was horizontal).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif" size="2"&gt;Hope that helps.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2017 06:07:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Simple-Annotation-on-Proc-Boxplot/m-p/330102#M11527</guid>
      <dc:creator>ABritinAus</dc:creator>
      <dc:date>2017-02-06T06:07:27Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Annotation on Proc Boxplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Simple-Annotation-on-Proc-Boxplot/m-p/331653#M11561</link>
      <description>Perfecto! You are the best. I really need to learn how to dig through SAS Documentation</description>
      <pubDate>Fri, 10 Feb 2017 19:54:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Simple-Annotation-on-Proc-Boxplot/m-p/331653#M11561</guid>
      <dc:creator>pkfamily</dc:creator>
      <dc:date>2017-02-10T19:54:41Z</dc:date>
    </item>
  </channel>
</rss>

