Hi everyone,
I am trying to add an annotation to an SGPANEL plot. You can see my code as follows:
DATA marg_anno;
length function widthunit justify anchor $10 label $100;retain drawspace function width widthunit textstyle justify anchor textsize;
drawspace="datavalue";
function="text";
width=10;
widthunit="data";
textstyle="normal";
justify="left";
anchor="left";
textsize=9;label = "P=&pval_marginal66";
x1=1;
y1=40;
output;
run;PROC SGPANEL data=marginal66 noautolegend sganno=marg_anno;
panelby median_dose;
series y=pred x=visno / group=median_dose;
scatter y=pred x=visno / errorbarattrs=(color=black) markerattrs=(size=0) yerrorlower=lower yerrorupper=upper;
colaxis values=(1 to 2 by 1);
label visno = "Visit" pred="Predicted GMFM-66";
format visno t.;
run;
The call to SGPANEL gives me the error: "WARNING: XSPACE= is invalid. Draw statement discarded"
I cannot see any reason why this would be the case. And, in fact, it gives me this error message regardless of what value I enter in, and regardless of the drawspace I enter. It tells me that it is invalid in every single case I have tried.
Does anybody have an idea what is going on? I tried searching this error, but have found nothing referencing it in the documentation or forums.
Well, I found the answer. My fault for not reading the documentation quite carefully enough. A little footnote at the bottom indicates that the only options that work with SGPANEL are GRAPHPERCENT, GRAPHPIXEL, LAYOUTPERCENT, and LAYOUTPIXEL, when I was trying to use WALLPERCENT and WALLPIXEL.
The "datavalue" drawspace cannot be used with SGPANEL because there are multiple "datavalue" spaces (i.e. panel cells), and there is currently not a way to address a particular cell. With SGPANEL, you must use percentage or pixel-based units for now.
I guess I should have been more specific in my OP, but when I said, " regardless of the drawspace I enter" that included both percentage and pixel-based units. It still gave me the same error. It doesn't matter which drawspace I use or how I try to define the positioning in SGPANEL, it always says that the XSPACE is invalid.
Well, I found the answer. My fault for not reading the documentation quite carefully enough. A little footnote at the bottom indicates that the only options that work with SGPANEL are GRAPHPERCENT, GRAPHPIXEL, LAYOUTPERCENT, and LAYOUTPIXEL, when I was trying to use WALLPERCENT and WALLPIXEL.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.