Hi All. I and creating a figure. I need to show different color for different reference line with continuous variable values.
Your question is too vague. Please show us the code that you have developped so far.
See if this example is helpful:
proc sgplot data=sashelp.class;
scatter x=height y=weight;
refline 75 / axis=Y lineattrs=(color=blue) label;
refline 100 / axis=Y lineattrs=(color=gold) label;
refline 125 / axis=Y lineattrs=(color=red) label;
run;
Make different variables for these different reference line .
data class;
set sashelp.class;
if _n_ in(6:10) then refline1=height;
if _n_ in(12:16) then refline2=height;
run;
proc sgplot data=class;
scatter x=height y=weight/group=sex;
refline refline1/axis=x lineattrs=graphdata1;
refline refline2/axis=x lineattrs=graphdata2;
run;
And for more ways to control and use reference lines, see "Add horizontal and vertical reference lines to SAS graphs: The REFLINE statement."
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.