BookmarkSubscribeRSS Feed
ballardw
Super User
I ran into some odd behavior with an annotate data set where I am placing squares as a symbol for one response group. All of the squares are the same color definition but the last one in the group is usually displayed in another color. I have stripped the data and code down to the following example.

When I tried this with different colors in the RECT macro call sometimes all of them seem similar in color but for most the last record in the data shows in a different color that does change depending upon the color specified and sometimes the active ODS style. The example below, running on Windows XP, SAS 9.2 TS Level 1 M0 with the SAS supplied MEADOWS style draws for raspberry colored rectangles and one dark blue (left bottom).

The coordinates used when displayed with my map data using GMAP do draw squares but GANNO below is re-scaling to use the values provided.

My questions are:
Does anyone else see this behavior?
What I am I missing to get all of these the same color.


%annomac;
data myanno;
input X Y ;
retain xsys ysys '2' when 'a';
step= 0.0015;
x1= x-step; x2=x+step;y1=y-step;y2=y+step;
%rect(x1,y1,x2,y2,H05A66AA,1,2);
drop step;
cards;
-0.030992 0.038752
-0.004153 -0.051241
-0.034223 0.016177
-0.026260 -0.033128
-0.034592 -0.024228
run;

proc ganno annotate=myanno datasys;run;quit;
1 REPLY 1
ArtC
Rhodochrosite | Level 12
The annomac %RECT is calling for the POLYLINE, which I believe has been replaced with the POLY function. I do not know what the interaction is, but replacing the macro call with its resultant code and replacing POLYLINE with POLY seemed to clear up the problem on my test. the code snippet becomes:
[pre]
%*rect(x1,y1,x2,y2,H05A66AA,1,2);
/*IF "H05A66AA" =: '*' THEN ;*/
/*ELSE */
color = "H05A66AA" ;
LINE = 1;
SIZE = 2;
x=x1;
y=y1;
function="POLY ";
output;
x=x2;
y=y1;
function="POLYCONT";
output;
x=x2;
y=y2;
function="POLYCONT";
output;
x=x1;
y=y2;
function="POLYCONT";
output;
x=x1;
y=y1;
function="POLYCONT";
output;
[/pre]
Another reason I tend to shy away from the %annomac macros.

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

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.

Get the $99 certification deal.jpg

 

 

Back in the Classroom!

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

View all other training opportunities.

Discussion stats
  • 1 reply
  • 774 views
  • 0 likes
  • 2 in conversation