BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
grsanford
Fluorite | Level 6

I cannot for the life of me figure out why specifiying no caps is overriding my y axis formating. Any help would be GREATLY appreciated! 

 

Y axis looks good, boxplots have caps...

 

proc sgpanel data=fig1 noautolegend;
panelby dpt / rows=2 columns=1 novarname uniscale=column;
vbox _value_ / group=system nomean lineattrs=(color=black) medianattrs=(color=black) whiskerattrs=(color=black);
refline 0 / lineattrs=(color=crimson);
run;

 

Y axis messed up, boxplots are cap-free...

 

proc sgpanel data=fig1 noautolegend;
panelby dpt / rows=2 columns=1 novarname uniscale=column;
vbox _value_ / group=system nomean lineattrs=(color=black) medianattrs=(color=black) whiskerattrs=(color=black) nocaps;
refline 0 / lineattrs=(color=crimson);
run;caps_nocaps.png

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

@grsanford , I have a better workaround than using the VALUES option. The box plots support the CAPSHAPE option. Just set CAPSHAPE=NONE, and you should get the result you need. 

View solution in original post

7 REPLIES 7
ChrisNZ
Tourmaline | Level 20

It works as expected for me. Maybe it's to do with the refline.

If that really bothers you, you should contact tech support, otherwise just set the axes as you want them.

proc sgpanel data=SASHELP.SHOES noautolegend;
  where REGION=:'A';
  panelby REGION / rows=2 columns=1 novarname uniscale=column;
  vbox SALES / group=PRODUCT nomean lineattrs=(color=black) medianattrs=(color=black) whiskerattrs=(color=black);
  refline 0 / lineattrs=(color=crimson);
run;

proc sgpanel data=SASHELP.SHOES noautolegend;
  where REGION=:'A';
  panelby REGION / rows=2 columns=1 novarname uniscale=column;
  vbox SALES / group=PRODUCT nomean lineattrs=(color=black) medianattrs=(color=black) whiskerattrs=(color=black) nocaps;
  refline 0 / lineattrs=(color=crimson);
run;

ChrisNZ_0-1721044469177.png

 

 

 

 

ballardw
Super User

I am not sure which one has the messed up axis as you don't provide anything in the outputs to tell.

Also, since you are not providing any YAXIS statement you are surrendering control to the defaults. The axis values would be based on rules provided by SAS which consider values to display in the space used. The NOCAPS option may result in using a little less space actually used influencing the the impact on the rules generating.

 

I seldom have a graph result where I don't go ahead and add XAXIS and YAXIS statements, or ROWAXIS and COLAXIS in the case of SGPANEL.

DanH_sas
SAS Super FREQ

Hey @grsanford , you have found a legitimate issue. The result of the issue will be that any fractional tick values will be dropped on the axis when you use the NOCAPS option. The workaround for now is to use the VALUES option to specify the tick values you want to see. If you would, please enter a ticket with Technical Support so that we can track this issue. Thanks! 

grsanford
Fluorite | Level 6

Dan, 

Good to know! Can I ask how/if I can use the values option to specify different values for the different panels? I will be sure to submit a ticket. 

DanH_sas
SAS Super FREQ

@grsanford , I have a better workaround than using the VALUES option. The box plots support the CAPSHAPE option. Just set CAPSHAPE=NONE, and you should get the result you need. 

grsanford
Fluorite | Level 6

Brilliant! Worked like a charm. 

 

Do you know if SAS is working on an easy way (i.e., without needing to create and annotate dataset) to add letters or asterices above figures to indicate statistical significance? I've used annontate often in the past but it takes forever to inch letters up or down, right or left, and then they are never exactle equidistant from whiskers etc...

 

I would asume that this could be automated. 

 

Thank you again for your help with this, I really appreciate it!

DanH_sas
SAS Super FREQ

Normally, I would use a TEXT plot for this sort of thing, as it works well in most cases. However, with a box plot, you do not have access to the numbers used to plot each box to correctly place the text around the box. I would consider using an "inside" AXISTABLE to put the significance text above or below the box plot.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 7 replies
  • 190 views
  • 0 likes
  • 4 in conversation