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

捕获.PNG

Hi, 

As you can see the image above, the median value is overlapped in the figure. The median value was displayed by "DISPLAYSTATS=(Median)", I want to reduce the size of the value. Can you help me?

Below is my program:

proc template;
define statgraph boxplot;
begingraph;
layout overlay /XAXISOPTS = (DISPLAY=all label="Scheduled Visit" TICKVALUEATTRS=(size=5pt))
YAXISOPTS = (LINEAROPTS=(VIEWMIN= &vmin. VIEWMAX= &vmax. MINORTICKCOUNT=1 MINORTICKS=TRUE
TICKVALUELIST=(-50 -40 -30 -20 -10 0 10 20 30 40 50 60 70 80 90 100 110 120 130 140 150))
label="Change from Baseline &unit."
LABELSPLITCHAR="!" LABELSPLITCHARDROP=TRUE LABELPOSITION=CENTER LABELFITPOLICY=SPLITALWAYS);
boxplot x=AVISIT y=chg / DATALABEL=chg legendlabel="" DISPLAYSTATS=(MEDIAN) ;

endlayout;

endgraph;
end;

run;

proc sgrender data=all template=boxplot;
by page;
run;

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

Currently, there are no options to direct control the text attributes from DISPLAYSTATS output. However, you can work around this by computing the median externally using the PROC MEANS or PROC SUMMARY procedures, match-merging that column with your original data, and then using an AXISTABLE to display the values. You be able to control the text attributes on the AXISTABLE via the statement's VALUEATTRS option. 

 

Let me know if you have any questions about this approach.

View solution in original post

2 REPLIES 2
DanH_sas
SAS Super FREQ

Currently, there are no options to direct control the text attributes from DISPLAYSTATS output. However, you can work around this by computing the median externally using the PROC MEANS or PROC SUMMARY procedures, match-merging that column with your original data, and then using an AXISTABLE to display the values. You be able to control the text attributes on the AXISTABLE via the statement's VALUEATTRS option. 

 

Let me know if you have any questions about this approach.

LoganKong
Calcite | Level 5

Thank you for your confirmation and suggestion! I will update to use AXISTABLE.

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 177 views
  • 1 like
  • 2 in conversation