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?
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!
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?
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 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.