BookmarkSubscribeRSS Feed
djbateman
Lapis Lazuli | Level 10

I just upgraded from SAS 9.3 to SAS 9.4 last month, and I am trying out a few new features.  One of which is using the LINECOLORGROUP= option in GTL for a spaghetti plot instead of looping through a template and adjusting all the GraphDataN color options.

 

I'm not sure if this is the issue, but my legends are not showing up in the order that I would like.  The POSNEG variable is coded as 1=Positive, 2=Negative, and 9=Non-Evaluable.  I would like the legend to show up in that order with Positive=blue, Negative=red, and Non-Evaluable=orange.  However, running the attached code, you can see that the legend comes out as Positive=blue, Non-Evaluable=red, and Negative=orange.  I originally thought that the legend was ordering in reverse alphabetical order, but as I looked at the data, it looks like it is coming out in the order in which the category values appear in the data.

 

Is there an option that I can change, or do I need to attempt some fun code as a workaround?

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 0 replies
  • 753 views
  • 0 likes
  • 1 in conversation