<?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: How to annotate boxplot (sgplot)? in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/How-to-annotate-boxplot-sgplot/m-p/461309#M15902</link>
    <description>&lt;P&gt;I believe the default DRAWSPACE is GraphPercent.&amp;nbsp; You need to change that to DataValue.&amp;nbsp; Since x-axis is character,&amp;nbsp;you will need to use XC1 as the column for a character value.&amp;nbsp; Or, you can use the TEXT plot statement (9.4M3) or SCATTER plot with MARKERCHAR to do the same without annotation.&lt;/P&gt;</description>
    <pubDate>Thu, 10 May 2018 13:13:15 GMT</pubDate>
    <dc:creator>Jay54</dc:creator>
    <dc:date>2018-05-10T13:13:15Z</dc:date>
    <item>
      <title>How to annotate boxplot (sgplot)?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-annotate-boxplot-sgplot/m-p/461267#M15901</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a simple boxplot:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=sashelp.cars;
	vbox invoice/ category=type;
run; 
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now, I want to annote this by adding some text (actually it's a number) above each box. I did somenthing like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data anno;
	input function $ x1 $ y1 label;
	datalines;
	text Hybrid 150000 10
	text SUV 150000 20
	text Sedan 150000 30
	text Sports 150000 15
	text Truck 150000 5
	text Wagon 150000 10
	;
run;

proc sgplot data=sashelp.cars sganno=anno;
	vbox invoice/ category=type;
run; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;As a result I get the following error:&lt;/P&gt;
&lt;P&gt;WARNING: The X1 option is the incorrect data type. The option will be ignored.&lt;BR /&gt;WARNING: The X1 option is the incorrect data type. The option will be ignored.&lt;BR /&gt;WARNING: The X1 option is the incorrect data type. The option will be ignored.&lt;BR /&gt;WARNING: The X1 option is the incorrect data type. The option will be ignored.&lt;BR /&gt;WARNING: The X1 option is the incorrect data type. The option will be ignored.&lt;BR /&gt;WARNING: The X1 option is the incorrect data type. The option will be ignored.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you tell me what's wrong and how to do it right?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2018 08:11:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-annotate-boxplot-sgplot/m-p/461267#M15901</guid>
      <dc:creator>chris2377</dc:creator>
      <dc:date>2018-05-10T08:11:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to annotate boxplot (sgplot)?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-annotate-boxplot-sgplot/m-p/461309#M15902</link>
      <description>&lt;P&gt;I believe the default DRAWSPACE is GraphPercent.&amp;nbsp; You need to change that to DataValue.&amp;nbsp; Since x-axis is character,&amp;nbsp;you will need to use XC1 as the column for a character value.&amp;nbsp; Or, you can use the TEXT plot statement (9.4M3) or SCATTER plot with MARKERCHAR to do the same without annotation.&lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2018 13:13:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-annotate-boxplot-sgplot/m-p/461309#M15902</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2018-05-10T13:13:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to annotate boxplot (sgplot)?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-annotate-boxplot-sgplot/m-p/461312#M15903</link>
      <description>&lt;P&gt;The data set that you are using for annotation is incorrect.&amp;nbsp;You&amp;nbsp;have switched the 'label' and x1 fields and you have not specified the coordinate systems. See if you can modify the following program to do what you want:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data anno;
retain function "text" 
       x1Space 'WallPercent'
       y1Space 'DataValue'
       x1 . y1 150000;
input label $ x1;
datalines;
Hybrid 8.3
SUV    25 
Sedan  41.7
Sports 58.3 
Truck  75 
Wagon  91.7
;


proc sgplot data=sashelp.cars sganno=anno;
	vbox invoice/ category=type;
run; 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 May 2018 13:30:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-annotate-boxplot-sgplot/m-p/461312#M15903</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-05-10T13:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to annotate boxplot (sgplot)?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-annotate-boxplot-sgplot/m-p/461313#M15904</link>
      <description>&lt;P&gt;This seems to put the same category value at the top of each box (at y=150,000).&amp;nbsp; If user wants to put the numeric values on top of each box (category), I believe the x variable needs to match the character axis, using XC1 as the column in the anno data set.&amp;nbsp; Personally, I would use a&amp;nbsp;TEXT plot&amp;nbsp; to draw these values (instead of annotation) as now VBOX allows overlays of basic plots.&lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2018 13:43:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-annotate-boxplot-sgplot/m-p/461313#M15904</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2018-05-10T13:43:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to annotate boxplot (sgplot)?</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/How-to-annotate-boxplot-sgplot/m-p/461325#M15905</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13856"&gt;@Jay54&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;Thanks a lot! I didn't think of overlaying the two plots.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But I'll still try to achieve the same output using annotate.&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13684"&gt;@Rick_SAS&lt;/a&gt;, thanks for the tips!&lt;/P&gt;</description>
      <pubDate>Thu, 10 May 2018 14:33:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/How-to-annotate-boxplot-sgplot/m-p/461325#M15905</guid>
      <dc:creator>chris2377</dc:creator>
      <dc:date>2018-05-10T14:33:18Z</dc:date>
    </item>
  </channel>
</rss>

