Data visualization with SAS programming

VBOX - define CAPSCALE

Accepted Solution Solved
Reply
Frequent Contributor
Frequent Contributor
Posts: 81
Accepted Solution

VBOX - define CAPSCALE

Dear all,

 

I want to define the width of the whisker caps by using CAPSCALE=2 under vbox, but the SAS help said it only applies to SAS 9.4M5 and to later releases. ANyone knows how should I define this in the previous SAS version?

 

Thank you so much!

 

Best,

Hua


Accepted Solutions
Solution
‎04-12-2018 03:59 PM
Super User
Posts: 13,034

Re: VBOX - define CAPSCALE

[ Edited ]

Did you by any chance try the CAPSHAPE option?

 

In a quick test at least with the style meadow the cap was considerably wider when using CAPSHAPE=Bracket or CAPSHAPE=Line than the default of serif. In the quick test these two options had the cap as wide as the box.

View solution in original post


All Replies
Super User
Posts: 13,034

Re: VBOX - define CAPSCALE

I suggest upgrading as the amount of work involved might well be quite excessive when modifying such a specific element. The thought that comes to mind is summarizing the data, determining the y values (assuming a vertical box plot) for the end of the whiskers and using an annotate data set with that information to draw lines at the correct points. Which may not apply if you are using the capshape =bracket option.

 

Which SAS version are you currently using?

 

It might help someone to show the code you are currently using for the plot, example data in form of a data set wouldn't hurt.

SAS Super FREQ
Posts: 1,265

Re: VBOX - define CAPSCALE

Yes, it would require some effort as outlined by Ballardw, which was the reason for this feature addition.  Most users want to reduce the size of the cap.  You seem to want to increase it.  Can you explain the reason?

Frequent Contributor
Frequent Contributor
Posts: 81

Re: VBOX - define CAPSCALE

Posted in reply to Sanjay_SAS

Boxplot_a5.png

Thank you Sanjay! This figure is what I get. You can see that the caps are too tiny and I want to make it more obvious.

Frequent Contributor
Frequent Contributor
Posts: 81

Re: VBOX - define CAPSCALE

Thank you for help, Ballardw. My SAS version is SAS 9.4 TS level 1M4. Since i'm using the computer in the lab, I don't have the permission to make any change to the software. 

The following is my code:

 

proc sgplot data=plot;
   vbox value / category=Time group=TreatName nofill
              MEANATTRS = (Symbol="CircleFilled" Size=4)
	      LINEATTRS=(Pattern= 1 )
	      /*CAPSCALE=2*/
              WHISKERATTRS =(Pattern= 1 )
		;
  keylegend/TITLE="" position=bottom;
  yaxis MAX= 0.75 MIN= 0.25 values=(0.25 to 0.75 by 0.05) LABEL="TVDI" ;
  xaxis VALUES= ("Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec") DISPLAY=(NOLABEL);
  refline 0.5 /LINEATTRS= (Pattern= 2);
run;

 

And a sample data is attached.

Solution
‎04-12-2018 03:59 PM
Super User
Posts: 13,034

Re: VBOX - define CAPSCALE

[ Edited ]

Did you by any chance try the CAPSHAPE option?

 

In a quick test at least with the style meadow the cap was considerably wider when using CAPSHAPE=Bracket or CAPSHAPE=Line than the default of serif. In the quick test these two options had the cap as wide as the box.

Frequent Contributor
Frequent Contributor
Posts: 81

Re: VBOX - define CAPSCALE

Sorry for the late reply. Yes, I tried them. The CAPSHAPE=Line looks better than the Bracket.Without the new version of SAS, I will use CAPSHAPE=Line instead of the default. Thanks, Ballardw.
☑ This topic is solved.

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

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