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?

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 0 replies
  • 1029 views
  • 0 likes
  • 1 in conversation