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

Hi, experts,

1.I use proc template to customize the graph template. Maybe due to the icon at the bottom, the label is far away from the Y-axis. I want to set the label="Survival Probability" in the graph closer to the Y-axis. 

2. How to set the legend in the upper right corner of Figure 2?

Thank you for your clarification. Thank you.

c76ff420c93a0e2d4ab8b41b95a88d0.png2eb5f2d4d4230a3b35d169d65dc9635.jpg

1 ACCEPTED SOLUTION

Accepted Solutions
DanH_sas
SAS Super FREQ

Your DRAWTEXT statement would look something like the following (Adjust the X value to taste. It should be a value < 0, since it is relative to the wall):

drawtext  textattrs=GraphLabelText "Survival Probability" / rotate=90 drawspace=wallpercent y=50 x=-10;

View solution in original post

4 REPLIES 4
DanH_sas
SAS Super FREQ

1. The axis label is getting pushed out because the length of the AXISTABLE labels at the bottom. Some options to fix the issue include the following:

  • disable the labels and rely on the color coding
  • Shorten the label using a user-defined format (this might not be possible, as you are probably sharing the group variable with the plot)
  • Disable the Y-axis label and use a DRAWTEXT statement to put the axis label closer to the axis (this is probably your best option)

2. The DISCRETELEGEND need to be inside your LAYOUT OVERLAY, and set the POSITION to be TOPRIGHT.

 

Hope this helps!

DanH_sas
SAS Super FREQ

Your DRAWTEXT statement would look something like the following (Adjust the X value to taste. It should be a value < 0, since it is relative to the wall):

drawtext  textattrs=GraphLabelText "Survival Probability" / rotate=90 drawspace=wallpercent y=50 x=-10;

joycefilm
Fluorite | Level 6
Thank you very much for your answer, which solved my first question
DanH_sas
SAS Super FREQ

Sorry, I realized that for #2, I accidentally put the SGPLOT option for positioning the legend. For GTL, you should use HALIGN=RIGHT and VALIGN=TOP. Thanks!

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 1181 views
  • 1 like
  • 2 in conversation