<?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 proc SGplot.  X axis out of order. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-SGplot-X-axis-out-of-order/m-p/470903#M120544</link>
    <description>&lt;P&gt;I'm generating a simple vbar chart with the Y axis being counts, and x axis being ranges that I created as text (i.e "0 to 5%", "5.01 to 10%" etc).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I plot the chart,&amp;nbsp; my X axis is out of order.&amp;nbsp; it'll go "0 to 5%", "10 to 15%", "5 to 10%".&amp;nbsp; How do I set the order in this scenario where the x axis is text?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

Proc sgplot data=gridwork.data;
vbar dist/ response=counts;
xaxis label=distribution;
yaxis label='counts;

run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Sun, 17 Jun 2018 19:05:45 GMT</pubDate>
    <dc:creator>mrdlau</dc:creator>
    <dc:date>2018-06-17T19:05:45Z</dc:date>
    <item>
      <title>proc SGplot.  X axis out of order.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-SGplot-X-axis-out-of-order/m-p/470903#M120544</link>
      <description>&lt;P&gt;I'm generating a simple vbar chart with the Y axis being counts, and x axis being ranges that I created as text (i.e "0 to 5%", "5.01 to 10%" etc).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I plot the chart,&amp;nbsp; my X axis is out of order.&amp;nbsp; it'll go "0 to 5%", "10 to 15%", "5 to 10%".&amp;nbsp; How do I set the order in this scenario where the x axis is text?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

Proc sgplot data=gridwork.data;
vbar dist/ response=counts;
xaxis label=distribution;
yaxis label='counts;

run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 17 Jun 2018 19:05:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-SGplot-X-axis-out-of-order/m-p/470903#M120544</guid>
      <dc:creator>mrdlau</dc:creator>
      <dc:date>2018-06-17T19:05:45Z</dc:date>
    </item>
    <item>
      <title>Re: proc SGplot.  X axis out of order.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-SGplot-X-axis-out-of-order/m-p/470906#M120547</link>
      <description>&lt;P&gt;Easiest method is to not use characters as your X axis. Instead use numeric values and then use a format to have them displayed for presentation.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Because its a categorical variable you can also use the VALUES = option on the XAXIS statement to have the order you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://documentation.sas.com/?docsetId=grstatproc&amp;amp;docsetTarget=p07m2vpyq75fgan14m6g5pphnwlr.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#n09f4ln7jq8gkan1w2nhlkzjcrqz" target="_blank"&gt;http://documentation.sas.com/?docsetId=grstatproc&amp;amp;docsetTarget=p07m2vpyq75fgan14m6g5pphnwlr.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#n09f4ln7jq8gkan1w2nhlkzjcrqz&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sgplot data=sashelp.cars;
xaxis values=("GMC" "Honda" "Hyundai") 
   offsetmin=0.2 offsetmax=0.2;
scatter x=make y=mpg_city; 
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;PS. please take some time to go through your historical posts and mark them as answered/solved with the correct response tagged.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/38339"&gt;@mrdlau&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm generating a simple vbar chart with the Y axis being counts, and x axis being ranges that I created as text (i.e "0 to 5%", "5.01 to 10%" etc).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I plot the chart,&amp;nbsp; my X axis is out of order.&amp;nbsp; it'll go "0 to 5%", "10 to 15%", "5 to 10%".&amp;nbsp; How do I set the order in this scenario where the x axis is text?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;

Proc sgplot data=gridwork.data;
vbar dist/ response=counts;
xaxis label=distribution;
yaxis label='counts;

run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jun 2018 19:16:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-SGplot-X-axis-out-of-order/m-p/470906#M120547</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2018-06-17T19:16:54Z</dc:date>
    </item>
  </channel>
</rss>

