BookmarkSubscribeRSS Feed
HSM9
Calcite | Level 5

Screen Shot 2017-11-28 at 18.38.05.png

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.

6 REPLIES 6
Reeza
Super User

Assuming you used REFLINE, did you try setting the line colour on the REFLINE statement using the LINEATRRS, specifically colour. 

 


@HSM9 wrote:

Screen Shot 2017-11-28 at 18.38.05.png

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.


 

HSM9
Calcite | Level 5

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.

Reeza
Super User

ATTRPRIORITY? 

You can search on here for how that functions. Only other thing I can think of ... without having data to test things. 

HSM9
Calcite | Level 5

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.

ballardw
Super User

@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: 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!

SAS Enterprise Guide vs. SAS Studio

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 6 replies
  • 3646 views
  • 0 likes
  • 3 in conversation