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."
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.