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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

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