BookmarkSubscribeRSS Feed
CedricLVQ
Calcite | Level 5

Hello everyone,

 

I'm a newbiein the use of annotate function in PROC GPLOT.

 

I try to generate graphs where the annotate help me to visualize changes (symbolised by vertical bars)

 

Here is the table I use to do to perform the annotate:

 

 CaptureSAS1.JPG

 

Then, I draw two 2 graphs.

 

the first one plotting coefficient by date_m and colored by Identifiant with the annotation which gives this result (works):

 

proc gplot data=MaCouleur;

     plot Coefficient * Date_M = Identifiant / annotate= anno;

run;

 

CaptureSAS2.jpg

The 2nd graph is pretty much the same as we color by variable Couleur and not Identifiant

 

proc gplot data=MaCouleur;

     plot Coefficient * Date_M = Couleurs / annotate= anno;

run;

 

CaptureSAS3.jpg

As you can see, the vertical bars are no more visible.

 

Someone would have any idea from where this comes from?

 

Here is the message I get from SAS log:

 

NOTE: ERROR DETECTED IN ANNOTATE= DATASET WORK.ANNO.

NOTE: PROBLEM IN OBSERVATION     1 -

      A CALCULATED COORDINATE LIES OUTSIDE THE VISIBLE AREA          

 

I hope my problem statement is clear enough to you. I suppose it is related to memory but I have no clue about how to be sure of it.

 

thanks in advance.

3 REPLIES 3
DanH_sas
SAS Super FREQ

You can try something like this, and you will not have to use annotate:

 

proc sgplot data=sashelp.class;
scatter x=weight y=height / group=sex;
refline 70 95 120 / axis=x label="mylabel" labeloc=inside
                    lineattrs=(color=red pattern=dash);
run;

You can use individual REFLINE statements if you need unique labels per line.

 

Hope this helps!

Dan

CedricLVQ
Calcite | Level 5

Thank you Dan for this alternative.

 

If possible, we will try to stay with the PROC GPLOT option and the annotate since we are using it through a macro that generates several graphs automatically on a weekly basis.

 

Anyone else has faced similar issues?

 

 

GraphGuy
Meteorite | Level 14

With sas/graph annotate, once you reach a certain number of annotate 'errors' it ignores further annotate commands. 

 

One way around this is to tell annotate to ignore the errors, and keep trying, by adding something like this to your annotate dataset...

 

data ignore_error;
function='seterror'; size=100000; output;
run;

data anno; set ignore_error anno;

run;

 

 

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 1033 views
  • 0 likes
  • 3 in conversation