Data visualization with SAS programming

PROC SGPLOT variable reordering

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 19
Accepted Solution

PROC SGPLOT variable reordering

Hi all,

When I am plotting a graph using SGPLOT, SAS reorders my observations when plotting the bars for each month using a VBAR statement.  I was curious to see if there is a way to keep the original order of the observations.

The table looks as follows...

Month       Count

January    100,000

February  200,000

March       300,000

....

When graphed, the month names get all mixed up and out of order.  Please let me know if you have any solutions!

Thanks!


Accepted Solutions
Solution
‎09-19-2014 04:51 PM
SAS Super FREQ
Posts: 925

Re: PROC SGPLOT variable reordering

On the XAXIS statement, set DISCRETEORDER=DATA, and you should get what you expect.

View solution in original post


All Replies
Solution
‎09-19-2014 04:51 PM
SAS Super FREQ
Posts: 925

Re: PROC SGPLOT variable reordering

On the XAXIS statement, set DISCRETEORDER=DATA, and you should get what you expect.

Occasional Contributor
Posts: 19

Re: PROC SGPLOT variable reordering

That's perfect.  Thank you!

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 396 views
  • 0 likes
  • 2 in conversation