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