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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 5040 views
  • 0 likes
  • 2 in conversation