Annotate not working at all, please check code?

Reply
Occasional Contributor
Posts: 8

Annotate not working at all, please check code?

Hi there,

I'm new to using the annotate function in SAS, but have followed a few examples and am having difficulties enabling the annotate facility to do anything at all! Please see the example below. My understanding that my produced gplot's font size should be dictated by the "Size = 10" found in the annotated dataset. However, I've modified this number from 2 to 20, and am seeing no effect in the produced HTML data plot.

Am I missing something here?

Additional Info:

  • I am aware some of the information below in the annotated dataset does nothing right now. It was just apart of the example, and I am first trying to achieve any effect, before I begin pulling out parts I have not yet learned.
  • I am using SAS Enterprise Guide, not sure if this matters.
  • XVariable is a character, YVariable is numeric.

Thanks,

Robert

/*** Output Chart ***/

  options orientation=landscape;

  goptions vsize=7 hsize=10 htitle= 12pt htext=10pt;

data work.annotate;

  set work.finaltable;

  length function $8 text $5;

  retain XSYS YSYS '2' Style 'Swiss' Function 'Label';

  Size = 10;

  Output;

run;

proc gplot data=work.finaltable anno=work.annotate;

  plot XVariable*YVariable / href=6 lhref=3 chref=crimson;

  symbol1 value=circle color=black ;

  label YVariable = 'YLabel' XVariable = 'XLabel';

  title1 'Chart Title';

run;

quit;

Super User
Super User
Posts: 7,942

Re: Annotate not working at all, please check code?

Whilst it may not answer your question, I would suggest moving to sgplot or GTL, examples can be found here: Graphically Speaking - Data Visualization with a focus on SAS ODS Graphics

SAS Employee
Posts: 982

Re: Annotate not working at all, please check code?

If you're creating your graphs in EG, chances are it is using device=activex.

SAS' activex implementation of the SAS/Graph procs doesn't support a lot of things. I would suggest changing to device=png instead (at least while you're trouble-shooting the annotate problem - once you get it working, you can change it back to activex to see if it works there also).


I'm not sure what your annotate dataset currently has in it (variables from finaltable), but I would recommend something like the following for your annotate dataset ...

data work.annotate; set work.finaltable;

length function $8 text $5;

xsys='2'; ysys='2'; hsys='3'; when='a';

x=XVariable; y=YVariable;

function='label'; style='albany amt'; position='5'; size=10;

text=trim(left(YVariable));  /* or whatever variable you want in the text */

run;


Ask a Question
Discussion stats
  • 2 replies
  • 197 views
  • 0 likes
  • 3 in conversation