Data visualization with SAS programming

Annotating an SGPANEL plot; "xspace invalid" error

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 98
Accepted Solution

Annotating an SGPANEL plot; "xspace invalid" error

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.


Accepted Solutions
Solution
‎07-15-2015 01:25 PM
Frequent Contributor
Posts: 98

Re: Annotating an SGPANEL plot; "xspace invalid" error

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.

View solution in original post


All Replies
SAS Super FREQ
Posts: 864

Re: Annotating an SGPANEL plot; "xspace invalid" error

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.

Frequent Contributor
Posts: 98

Re: Annotating an SGPANEL plot; "xspace invalid" error


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.

Solution
‎07-15-2015 01:25 PM
Frequent Contributor
Posts: 98

Re: Annotating an SGPANEL plot; "xspace invalid" error

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.

Post a Question
Discussion Stats
  • 3 replies
  • 501 views
  • 0 likes
  • 2 in conversation