Easiest is just to change the LabelPos to one of of those to be MAX.
If you want to explicitly control the location of text I suggest adding observations to your data set to allow use of a TEXT plot statement with the X, Y location and a variable to hold the text. Then do not include a label on the line at all. The Text plot would allow a few more options for displaying the text.
@Jepi wrote:
Thanks! With setting one to MAX and the other to MIN. The 50 refline still runs through the 40 refline label.
Does X and Y have to be numeric?
Now we are at the point where you should provide an example of the data set you are using for proc sgplot and the entire code of the Sgplot used.
Refline values do not have to be numeric but if you are using a character value for the line that it is not one of the actual values results are at best unpredictable and likely to not appear at all.
Example of a not very useful graph but shows use of text values for refline when the axis is character:
Proc sgplot data=sashelp.cars; scatter x=make y=type; refline 'Isuzu' /axis=x ; refline 'Sedan' /axis=y ; run;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.