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

I applied format for response variable when create the hbar plot with segment label.

But, some segments widths are so narrow, then format didn't work. 

Here is the plot.  

 

 

image.png

 

 

Actually brown colored segment should be print as "L". Also, the real value of brown colored segment is 2.778. 

But with below code, the segment is printed out as "3" not "L". 

I think the reason why this problems has happened  because of  segment width is so narrow.

How can I print brown colored segment with formatted letter? 

Thanks. 

 

ods graphics / reset width=12in height=6in imagename='full';
proc sgplot data=graph ;
format score fmtv.  ;
hbar site / response=score group=risk_num seglabel seglabelattrs=(size=10 weight=bold) ;
yaxis grid discreteorder=data display=(nolabel) valueattrs=(size=12);
xaxis values=(0 10 20 30 40 50 60 ) valuesdisplay=("0" "10" "20" "30" "40" "50" "60") label="Total Risk Score" labelattrs=(size=11) valueattrs=(weight=bold size=11) ;
refline &all_mean / axis=x lineattrs=(color=red thickness=3) label='[Overall Mean:&all_mean]' labelattrs=(weight=bold size=11) labelpos=min labelloc=outside; ;
discretelegend / title="" position=bottom valueattrs=(size=12) noborder ;
run;
ods graphics / reset=width;

 

 

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

Add SEGLABELFITPOLICY=NONE to the HBAR options.  By default, the fit policy is to "thin" the labels that don't fit in the bars.

View solution in original post

2 REPLIES 2
Rick_SAS
SAS Super FREQ

Add SEGLABELFITPOLICY=NONE to the HBAR options.  By default, the fit policy is to "thin" the labels that don't fit in the bars.

shoh
Calcite | Level 5

Thanks for your comment. It's very helpful. 

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
  • 2 replies
  • 985 views
  • 1 like
  • 2 in conversation