Hi all,
I have a graph as shown below. I want to add reference lines' labels for each line but it is not printed and in the log I get this message
' CURVELABEL='1' is invalid. The option value cannot be a string when a column of reference
lines is plotted. The label will not be drawn."
Here is my code. Could you help me what I am missing?
%macro try3(m);
%do i=1 %to 12;
proc sgplot data=all_per_grade_w&i.;
where group in ("2" , "4"); /* restrict to two groups */
density writing_scale_score/ type=normal group=group;
refline scale_score_n /LABEL= ('1' '2' '3' '4' '5' '6') lineattrs=(color=red) axis=x discreteoffset=0.5 axis=x ; ;
xaxis values =(100 to 600 by 50); ;
yaxis display=(noline noticks nolabel) grid;
run;
%end;
run;
%mend;
%try3;
I think you have to specify a column:
specifies a label for the reference line or lines.
Requirement | If you use the COLN() or COLC() function in the X= or Y= option to specify multiple reference line intercepts, then you must use the COLC() function in the CURVELABEL= option to specify exactly one label for each reference line intercept. Otherwise, this option is ignored. See GTL Functions Used with the EVAL Function. |
Interactions | If the X or Y argument specifies a value, then use "string". |
If the X or Y argument specifies a column, then use a column to define the label for each value. |
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.
Find more tutorials on the SAS Users YouTube channel.