<?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 output order in boxplot in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/output-order-in-boxplot/m-p/46853#M1585</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With the SGPLOT procedure (SAS 9.2), you can set DISCRETEORDER=data on the XAXIS statement to get data order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="BoxOrder.png" class="jive-image-thumbnail jive-image" onclick="" src="https://communities.sas.com/legacyfs/online/1261_BoxOrder.png" width="450" /&gt;&lt;/P&gt;&lt;PRE lang="sas"&gt;data box;
&amp;nbsp; do x='Nh', 'Nt', 'Nc';
&amp;nbsp;&amp;nbsp;&amp;nbsp; do i=1 to 10;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y=10*ranuni(2);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;
&amp;nbsp;&amp;nbsp;&amp;nbsp; end;
&amp;nbsp; end;
run;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
ods listing;
ods graphics / reset width=5in height=3in imagename='BoxOrder';
proc sgplot data=box;
&amp;nbsp; vbox y / category=x;
&amp;nbsp; xaxis display=(nolabel) discreteorder=data;
&amp;nbsp; run;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 13 Nov 2011 18:17:00 GMT</pubDate>
    <dc:creator>Jay54</dc:creator>
    <dc:date>2011-11-13T18:17:00Z</dc:date>
    <item>
      <title>output order in boxplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/output-order-in-boxplot/m-p/46852#M1584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd like to use boxplot to make comparisons between three variables, say, Nh, Nt, Nc. I'd like to see the three boxplots side by side in the order: Nh, Nt, Nc. But the output displayed the boxplots in the order: Nc, Nh, Nt (alphabetically). How can I change the order to the one I want? Thanks!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Nov 2011 16:04:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/output-order-in-boxplot/m-p/46852#M1584</guid>
      <dc:creator>andrew0845</dc:creator>
      <dc:date>2011-11-13T16:04:19Z</dc:date>
    </item>
    <item>
      <title>output order in boxplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/output-order-in-boxplot/m-p/46853#M1585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With the SGPLOT procedure (SAS 9.2), you can set DISCRETEORDER=data on the XAXIS statement to get data order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="BoxOrder.png" class="jive-image-thumbnail jive-image" onclick="" src="https://communities.sas.com/legacyfs/online/1261_BoxOrder.png" width="450" /&gt;&lt;/P&gt;&lt;PRE lang="sas"&gt;data box;
&amp;nbsp; do x='Nh', 'Nt', 'Nc';
&amp;nbsp;&amp;nbsp;&amp;nbsp; do i=1 to 10;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y=10*ranuni(2);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;
&amp;nbsp;&amp;nbsp;&amp;nbsp; end;
&amp;nbsp; end;
run;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
ods listing;
ods graphics / reset width=5in height=3in imagename='BoxOrder';
proc sgplot data=box;
&amp;nbsp; vbox y / category=x;
&amp;nbsp; xaxis display=(nolabel) discreteorder=data;
&amp;nbsp; run;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Nov 2011 18:17:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/output-order-in-boxplot/m-p/46853#M1585</guid>
      <dc:creator>Jay54</dc:creator>
      <dc:date>2011-11-13T18:17:00Z</dc:date>
    </item>
    <item>
      <title>output order in boxplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/output-order-in-boxplot/m-p/46854#M1586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Sorry I didn't make it clear. First, I'd like to use proc boxplot. Second, I'd like to control the order of the boxes in the boxplots. Not necessarily Nh, Nt, Nc, but maybe Nt, Nc, Nh. Would you please tell me how to do that using proc boxplot? Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Nov 2011 19:29:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/output-order-in-boxplot/m-p/46854#M1586</guid>
      <dc:creator>andrew0845</dc:creator>
      <dc:date>2011-11-13T19:29:28Z</dc:date>
    </item>
    <item>
      <title>Re: output order in boxplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/output-order-in-boxplot/m-p/46855#M1587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: arial, helvetica, sans-serif;"&gt;You could manipulate your data so that the values of your boxes are in alphabetical order, and then create a format so that what displays is still the meaningful names, like 'Nt', 'Nc', and 'Nh'. For example: &lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;data box;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; do x='V3', 'V1', 'V2';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; do i=1 to 10;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y=10*ranuni(2);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;proc format;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;value $myboxval &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'V1' = 'Nt'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'V2' = 'Nc'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;'V3' = 'Nh';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;proc sort data=box;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;by x;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;ods listing;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;ods graphics / reset width=5in height=3in imagename='BoxOrder';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;footnote '';&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;proc boxplot data=box;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; format x $myboxval.;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; plot y*x=i;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;﻿&lt;IMG alt="box.PNG" class="jive-image-thumbnail jive-image" onclick="" src="https://communities.sas.com/legacyfs/online/1263_box.PNG" width="450" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 13 Nov 2011 23:33:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/output-order-in-boxplot/m-p/46855#M1587</guid>
      <dc:creator>Joeldw</dc:creator>
      <dc:date>2011-11-13T23:33:52Z</dc:date>
    </item>
    <item>
      <title>output order in boxplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/output-order-in-boxplot/m-p/46856#M1588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the existing data set, the order is Nh, Nt, Nc. I know in proc freq, one can use "order=data" but not in proc boxplot. I don't want to restructure the data set. How can I solve the problem? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2011 03:04:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/output-order-in-boxplot/m-p/46856#M1588</guid>
      <dc:creator>andrew0845</dc:creator>
      <dc:date>2011-11-14T03:04:35Z</dc:date>
    </item>
    <item>
      <title>output order in boxplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/output-order-in-boxplot/m-p/46857#M1589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can pad white blank before value of variables to customize your order.&lt;/P&gt;&lt;P&gt;Make sure that your variable has long enough to hold these white blanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data box;
length x $ 8;
&amp;nbsp; do x='Nt', 'Nc', 'Nh';
&amp;nbsp;&amp;nbsp;&amp;nbsp; do i=1 to 10;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; y=10*ranuni(2);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;
&amp;nbsp;&amp;nbsp;&amp;nbsp; end;
&amp;nbsp; end;
run;
data box;
 set box;
 if x='Nt' then x='&amp;nbsp; Nt';
&amp;nbsp; else x='Nc' then x=' Nc';
run;
 

ods listing;

ods graphics / reset width=5in height=3in imagename='BoxOrder';

footnote '';

proc boxplot data=box;

&amp;nbsp; plot y*x=i;

&amp;nbsp; run;

&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2011 07:14:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/output-order-in-boxplot/m-p/46857#M1589</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-11-14T07:14:54Z</dc:date>
    </item>
    <item>
      <title>output order in boxplot</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/output-order-in-boxplot/m-p/46858#M1590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Add a dummy variable to the data set that has the values 1, 2, ...,k, where k is the number of categories. Then use a user-defined format as shown by &lt;/P&gt;&lt;P&gt;@&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" href="https://communities.sas.com/people/Joeldw" id="jive-259021764933829264803" onmouseout="" onmouseover=""&gt;Joeldw&lt;/A&gt; to map the dummy variable to the categorical values.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2011 13:35:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/output-order-in-boxplot/m-p/46858#M1590</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2011-11-14T13:35:18Z</dc:date>
    </item>
  </channel>
</rss>

