BookmarkSubscribeRSS Feed
_Hopper
Obsidian | Level 7

How do you use multiple attributes in the single plot?

 

For example, I a swimmer plot where category 1, 2, and 3 events are colored green, yellow and red, respectively. What if there is another variable I want to use to create a hatched pattern overlay?

 

3 REPLIES 3
DanH_sas
SAS Super FREQ

You can put all of your maps in the same data set using different IDs:

 

data attrmap;
length ID $ 9 linecolor markercolor fillcolor $ 10;
input id $ value $10-30 linecolor $ markercolor $ fillcolor $;
show='ATTRMAP';
datalines;
status   Complete response    darkred   darkred  gray    
status   Partial response     blue      blue     gray
stage    Stage 1              darkred   darkred  green
stage    Stage 2              black     black    yellow
stage    Stage 3              black     black    orange
stage    Stage 4              black     black    red
;
run;

Then, use the ATTRID option from each plot overlay to use the correct ID value.

 

Hope this helps!

_Hopper
Obsidian | Level 7

This I understand - what if I want to use a different dataset variable to set another attribute? I want to keep the colors as is that works; however, if I only want certain bars to have a crosshatch pattern based on another dataset variable, how do I do that?

DanH_sas
SAS Super FREQ

Sorry, I missed the cross-hatched part of your request. Assuming you're using a bar-type HIGHLOW for this, I would split the data based on this variable and overlay two HIGHLOW plots, with one of them having FILLPATTERNS enabled. You should be able to use the attrmap for coloring both overlays. Would that work for you?

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 3 replies
  • 937 views
  • 0 likes
  • 2 in conversation