Hi there,
I’m creating a plot (i.e. empirical density function) and I’m including a vertical line corresponding with a the cut-off value '&max' in the REFLINE statement (see code below).
Nevertheless, the actual value is not displayed at the bottom of the line. Can you please let me know how can I do that?
Thanks a lot,
A.G.
proc sgplot data=dat cycleattrs ;
density &var/ LINEATTRS=(color=daolg)type=kernel(c=25) scale=density freq=&weight legendlabel="prior";
xaxis label="&label" min= 0 max=&mx;
yaxis label='Empirical density function(EDF)';
*Inserting cut-off values as vertical lines;
refline &max / axis=x lineattrs=(thickness=3 color=darkred pattern=dash)
label=("UL");
run;
You have not provided anything that might hold the value to the Label
If &max is a single value then add that to the Label ="UL &max"
If your &max is more than a single value then you need to describe things a bit better and may be better off adding some records to the data set with the values and having the variable containing the Refline values instead of a list, then use that or a variable build to hold the desired text in the Label= option.
You have not provided anything that might hold the value to the Label
If &max is a single value then add that to the Label ="UL &max"
If your &max is more than a single value then you need to describe things a bit better and may be better off adding some records to the data set with the values and having the variable containing the Refline values instead of a list, then use that or a variable build to hold the desired text in the Label= option.
@alexgonzalez wrote:
Hi BallardW,
Thanks for your recommendation. &max is indeed a single value. I thought about that obtion, but I rather have the value displayed at the bottom of the X axis and at the top the label 'UL'.
Regards,
A.G.
As far as I know you only get one label position per refline. But I bet if you add a second Refline statement with the LABELPOS=max (this is a standard parameter NOT your macro variable) and Label="&max" that you get what you want.
You are drawing the same line twice with two different labels.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.