Data visualization with SAS programming

draws a horizontal line at the 0 value on the axis in boxplot

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 78
Accepted Solution

draws a horizontal line at the 0 value on the axis in boxplot

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


Accepted Solutions
Solution
‎03-27-2017 04:27 PM
Super User
Posts: 19,038

Re: draws a horizontal line at the 0 value on the axis in boxplot

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


All Replies
Super User
Posts: 19,038

Re: draws a horizontal line at the 0 value on the axis in boxplot

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. 

Frequent Contributor
Posts: 78

Re: draws a horizontal line at the 0 value on the axis in boxplot

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

Solution
‎03-27-2017 04:27 PM
Super User
Posts: 19,038

Re: draws a horizontal line at the 0 value on the axis in boxplot

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);
Frequent Contributor
Posts: 78

Re: draws a horizontal line at the 0 value on the axis in boxplot

Hi Reeza,

 

Yes, that's helpful!!!

Thanks so much!

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 194 views
  • 0 likes
  • 2 in conversation