Ive put this figure together with this code but in the results windows, the keylegend has values, as it should , but it always appears in a column. Ive tried running different across and down statements.
Also, it does not appear in the pdf file I save it to, but does appear in an RTF or word file. Why?
I just went to change the discretelegend or keylegend so it is on one line. For some reason keylegend does not work in this code .
ods listing close;
ods html style=mystyle path='.' file='newgraph.html';
ods graphics / reset=all border=off width=600 height=800 maxlegendarea=45 ;
proc sgplot data=glm_MAP2 nowall noborder ;
title 'Linear Regression Models with Parameter estimates and SD for MAP';
styleattrs datacontrastcolors=(CX016381 CX1BC9FF CXFF7F00 CX814101 ) ;
refline "mean Nex" "mean LA" "mean UA" "mean LL"/ discretethickness=1 lineattrs=(color=pink) axis=y;
hbarparm category=IV response= Param / group =DV groupdisplay =cluster grouporder=data
barwidth=0.4 clusterwidth=1 limitupper=SD_Param ;
yaxis type=discrete discreteorder=data label =".";
xaxis label =".";
discretelegend / across=1 location=outside noborder;
yaxistable N rpIII rParam rLCL rUCL/ VALUEATTRS=(Color=Black Family=Arial Size=7 Weight=Normal ) VALUEHALIGN=CENTER VALUEJUSTIFY= CENTER ;
run;
I
This is the error I get when I use "Down=1":
NOTE: PROCEDURE SGPLOT used (Total process time):
real time 0.38 seconds
cpu time 0.20 seconds
WARNING: DISCRETELEGEND statement with DISPLAYCLIPPED=FALSE is getting clipped. The legend will not be drawn.
WARNING: DISCRETELEGEND statement with DISPLAYCLIPPED=FALSE is getting clipped. The legend will not be drawn.
WARNING: The font <sans-serif> is not available. Albany AMT will be used.
WARNING: DISCRETELEGEND statement with DISPLAYCLIPPED=FALSE is getting clipped. The legend will not be drawn.
WARNING: The font <sans-serif> is not available. Albany AMT will be used.
NOTE: There were 28 observations read from the data set USER.GLM_MAP2.
92
93 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
Same thing with "Across=7":
NOTE: PROCEDURE SGPLOT used (Total process time):
real time 0.42 seconds
cpu time 0.20 seconds
WARNING: DISCRETELEGEND statement with DISPLAYCLIPPED=FALSE is getting clipped. The legend will not be drawn.
WARNING: DISCRETELEGEND statement with DISPLAYCLIPPED=FALSE is getting clipped. The legend will not be drawn.
WARNING: The font <sans-serif> is not available. Albany AMT will be used.
WARNING: DISCRETELEGEND statement with DISPLAYCLIPPED=FALSE is getting clipped. The legend will not be drawn.
WARNING: The font <sans-serif> is not available. Albany AMT will be used.
NOTE: There were 28 observations read from the data set USER.GLM_MAP2.
92
93 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
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.