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

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

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

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

6 REPLIES 6
ballardw
Super User

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.

Jay54
Meteorite | Level 14

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?

hua
Obsidian | Level 7 hua
Obsidian | Level 7

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.

hua
Obsidian | Level 7 hua
Obsidian | Level 7

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.

ballardw
Super User

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.

hua
Obsidian | Level 7 hua
Obsidian | Level 7
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.

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