BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
echoli
Obsidian | Level 7

Hi All,

 

How can I draw a horizontal line at 0 value on the axis to make the 0 line more clear?

here is my code:

proc sgplot data=boxplot_BASILAR_VOL;
vbox BASILAR_VOL / category = group group = group
lineattrs=(pattern=solid) whiskerattrs=(pattern=solid);
xaxis display=(nolabel) type = discrete labelattrs = (size = 15pt Weight = Bold) valueattrs = (size = 20pt);
yaxis grid labelattrs = (size = 20pt Weight = Bold) valueattrs = (size = 15pt);
keylegend / location = inside position = topright across = 1;
run;

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Sorry, it's REFLINE not HREF, you may want to play around with the THICKNESS option.

I can't test it because you're referencing your data. It's preferable to use code that references a dataset in SASHELP then we can test code as we suggest it. 

 

refline 0 / axis = y LINEATTRS=(Color=black thickness=10);

View solution in original post

4 REPLIES 4
Reeza
Super User

Add an HREF line with the properties you want?

 

Another option is to change the lines to be light grey except for the 0 line. 

echoli
Obsidian | Level 7

Hi Reeza,

 

Coule you give me more explanation please? Can I make 0 line as black. My boxplot graph already have the light grey lines.

Thanks,

boxplot.png

Reeza
Super User

Sorry, it's REFLINE not HREF, you may want to play around with the THICKNESS option.

I can't test it because you're referencing your data. It's preferable to use code that references a dataset in SASHELP then we can test code as we suggest it. 

 

refline 0 / axis = y LINEATTRS=(Color=black thickness=10);
echoli
Obsidian | Level 7

Hi Reeza,

 

Yes, that's helpful!!!

Thanks so much!

 

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!

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