I have the following box plot made using PROC SGPLOT. I got the color of the actual boxplot correct by adding this statement: FILLATTRS= (COLOR=LIGHTRED). Now I want to change the colors of the lines of the boxplot so they all are black. If you need my code, just let me know, but it is rather long, and thought maybe someone knew the statement to just change the color of the lines.
Assuming you used REFLINE, did you try setting the line colour on the REFLINE statement using the LINEATRRS, specifically colour.
@HSM9 wrote:
I have the following box plot made using PROC SGPLOT. I got the color of the actual boxplot correct by adding this statement: FILLATTRS= (COLOR=LIGHTRED). Now I want to change the colors of the lines of the boxplot so they all are black. If you need my code, just let me know, but it is rather long, and thought maybe someone knew the statement to just change the color of the lines.
refline 90 / label= "Hypertension Threshold"
lineattrs= (color=red);
vbox dbp / group = ethracecd
fillattrs= (color=lightred) lineattrs= (color = black);
Yes, I did add a refline. This is that part of the code. I tried using a lineattr to color the actual plot, but that does not change anything, but does not create an error.
ATTRPRIORITY?
You can search on here for how that functions. Only other thing I can think of ... without having data to test things.
Hm, yeah this does not work for some reason after trying multpile different ways. No error messages, but color stays the same. I'll see if I can find other things to try.
@HSM9 wrote:
refline 90 / label= "Hypertension Threshold"
lineattrs= (color=red);
vbox dbp / group = ethracecd
fillattrs= (color=lightred) lineattrs= (color = black);
Yes, I did add a refline. This is that part of the code. I tried using a lineattr to color the actual plot, but that does not change anything, but does not create an error.
Per the documentation the lineattrs option is ignored if the GROUP= option is also specified.
Instead of Group= try using CATEGORY=.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.