BookmarkSubscribeRSS Feed
dustychair
Pyrite | Level 9

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;

 

 

 

 

 

 

dustychair_0-1595550068784.png

 

 

1 REPLY 1
Norman21
Lapis Lazuli | Level 10

I think you have to specify a column:

 

https://documentation.sas.com/?docsetId=grstatgraph&docsetTarget=p03jtr6n56wu4ln1k77szqw1fjkc.htm&do...

 

CURVELABEL="string" | column | expression

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.
Norman.
SAS 9.4 (TS1M6) X64_10PRO WIN 10.0.17763 Workstation

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Tips for filtering data sources in SAS Visual Analytics

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.

Discussion stats
  • 1 reply
  • 1327 views
  • 0 likes
  • 2 in conversation