BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.

Hi,

Should SGPLOT honor  DiscreteOrder= for a scatter plot?  I read the docs as saying yes, it should respect discreteorder for any plot that has a discrete axis.

But I seem to get DiscreteOrder=data no matter what, e.g.:

proc sort data=sashelp.class out=class;
   by descending name;
 run;
 proc sgplot data=class noautolegend;
  scatter x=name y=height / markerattrs=(symbol=diamondfilled) ;
 * vbox height/category=name;
  xaxis type=discrete discreteorder=unformatted;
 run;

When I use vbox, discreteorder is honored.

Maybe I'm just reading the docs wrong.  :

DISCRETEORDER= DATA | FORMATTED | UNFORMATTED
specifies the order in which discrete tick values are placed on the axis. Specify one of the following values:
DATA places the values in the order in which they appear in the data. 
FORMATTED sorts the formatted values in ascending character order. 
UNFORMATTED sorts the unformatted values in ascending character order. 
Default:UNFORMATTED 
Restriction:This option affects only box plots, dot plots, bar charts, and line plots, or for any axis where TYPE=DISCRETE. 

I read the restriction as suggesting DISCRETEORDER should be honored for a scatterplot  whent TYPE=Discrete.

Not a big problem, cuz I can just sort the data.  But wanted to ask.

Thanks,

--Q.


BASUG is hosting free webinars Next up: Mike Sale presenting Data Warehousing with SAS April 10 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

The last part of the line is incorrect. The DISCRETEORDER option is honored only for VBOX/HBOX, VBAR/HBAR, VLINE/HLINE, and DOT.

Thanks!

Dan

View solution in original post

2 REPLIES 2
DanH_sas
SAS Super FREQ

The last part of the line is incorrect. The DISCRETEORDER option is honored only for VBOX/HBOX, VBAR/HBAR, VLINE/HLINE, and DOT.

Thanks!

Dan

Quentin
Super User

Gotcha. Thanks much.

BASUG is hosting free webinars Next up: Mike Sale presenting Data Warehousing with SAS April 10 at noon ET. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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