<?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 SGPLOT VBOX - Category Order in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBOX-Category-Order/m-p/342006#M11861</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to complete a boxplot, but the group order in figure is not what I want. As in the figure below, I want the group order is E9.5, E10.5, E11.5. And here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sgplot data=lab;&lt;BR /&gt;vbox lin__1 / category=group group=group gropdisplay=cluster&lt;BR /&gt;lineattrs=(pattern=solid) whiskerattrs=(pattern=solid);&lt;BR /&gt;xaxis display=(nolabel);&lt;BR /&gt;yaxis grid;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any way can change it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;Thanks,&lt;/P&gt;&lt;P&gt;Chen&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/7806iD34B5EDDD3AAA65C/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="sgplot_1.png" title="sgplot_1.png" /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 17 Mar 2017 15:11:22 GMT</pubDate>
    <dc:creator>echoli</dc:creator>
    <dc:date>2017-03-17T15:11:22Z</dc:date>
    <item>
      <title>SGPLOT VBOX - Category Order</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBOX-Category-Order/m-p/342006#M11861</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to complete a boxplot, but the group order in figure is not what I want. As in the figure below, I want the group order is E9.5, E10.5, E11.5. And here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sgplot data=lab;&lt;BR /&gt;vbox lin__1 / category=group group=group gropdisplay=cluster&lt;BR /&gt;lineattrs=(pattern=solid) whiskerattrs=(pattern=solid);&lt;BR /&gt;xaxis display=(nolabel);&lt;BR /&gt;yaxis grid;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any way can change it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;Thanks,&lt;/P&gt;&lt;P&gt;Chen&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/7806iD34B5EDDD3AAA65C/image-size/original?v=1.0&amp;amp;px=-1" border="0" alt="sgplot_1.png" title="sgplot_1.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2017 15:11:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBOX-Category-Order/m-p/342006#M11861</guid>
      <dc:creator>echoli</dc:creator>
      <dc:date>2017-03-17T15:11:22Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT VBOX - Category Order</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBOX-Category-Order/m-p/342009#M11862</link>
      <description>&lt;P&gt;Lots of options, but a simple way is to sort the data in the data set and then use&lt;/P&gt;
&lt;P&gt;the GROUPORDER=DATA option on the VBOX statement.&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2017 15:19:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBOX-Category-Order/m-p/342009#M11862</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-03-17T15:19:33Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT VBOX - Category Order</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBOX-Category-Order/m-p/342013#M11863</link>
      <description>&lt;P&gt;Another option is to use CATEGORY= instead of GROUP=. &amp;nbsp;Then you can set the values by using the XAXIS statement, as this example shows:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
proc sgplot data=sashelp.cars;
   vbox mpg_city / category=origin;
   xaxis type=discrete values=('USA' 'Asia' 'Europe');
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 17 Mar 2017 15:23:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBOX-Category-Order/m-p/342013#M11863</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2017-03-17T15:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: SGPLOT VBOX - Category Order</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBOX-Category-Order/m-p/342015#M11864</link>
      <description>&lt;P&gt;Hi Chen,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can try out the &lt;STRONG&gt;grouporder&lt;/STRONG&gt; option within vbox. Another options that will definitely work is to create a format based on the variable &lt;STRONG&gt;group.&lt;/STRONG&gt;&amp;nbsp;So you can create a numeric column based on group, i.e. &lt;STRONG&gt;groupn&lt;/STRONG&gt;, and that will have the values, 1, 2 and 3. Then&amp;nbsp;you can use that numeric variable in the plot: i.e.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc format;&lt;/P&gt;&lt;P&gt;&amp;nbsp; value grouporder 1 = "&lt;SPAN&gt;E9.5"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2 = "E10.5"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3 = "E11.5";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;proc sort data = lab;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; by groupn;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;proc sgplot data=lab;&lt;BR /&gt;vbox lin__1 / category=groupn group=groupn gropdisplay=cluster&lt;BR /&gt;lineattrs=(pattern=solid) whiskerattrs=(pattern=solid);&lt;BR /&gt;xaxis display=(nolabel);&lt;BR /&gt;yaxis grid;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;format groupn grouporder.;&lt;BR /&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2017 15:26:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/SGPLOT-VBOX-Category-Order/m-p/342015#M11864</guid>
      <dc:creator>djrisks</dc:creator>
      <dc:date>2017-03-17T15:26:12Z</dc:date>
    </item>
  </channel>
</rss>

