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

Hi there,

 

I want to generate a panel of histogram by using PRCO SGPANEL. Please see my codes below. The output is attached. Why the lable='median' does not show beside each line in the plot? Thank you in advance. 

 

proc sgpanel data=test;
panelby group;
histogram q2;
refline medianline_q2/axis=x lineattrs=(color=red) label="median";
run;

 


panel histogram.PNG
1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

Ah..it's drawing the label multiple times. Sorry about that. Instead of RETAINing the value, add the value to the LABEL column only once per cell value. That should do it.

 

Thanks!
Dan

View solution in original post

4 REPLIES 4
DanH_sas
SAS Super FREQ

When your refline values come from a variable, your labels must also come from a variable. Try RETAINing the "median" value in a variable and referencing that variable from the LABEL option.

 

Hope this helps!

Dan

Tiny_Kane
Obsidian | Level 7

Hi Dan,

 

Thanks for your solution. I tried to create a variable with value='Median' then apply it to the Label option..However, the output looks a little ungly. Do do have any way to refine the font of the label? See the attached plot. 

 

Thank you!

 


panel histogram.PNG
DanH_sas
SAS Super FREQ

Ah..it's drawing the label multiple times. Sorry about that. Instead of RETAINing the value, add the value to the LABEL column only once per cell value. That should do it.

 

Thanks!
Dan

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
  • 4 replies
  • 2224 views
  • 0 likes
  • 2 in conversation