BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
xpli
Calcite | Level 5

I heard that show='ATTRMAP' will show the missing group in the legend. I tried the following code but it is not working. Can anyone help ? thanks. 

 

data order;

input Value $ n;

retain ID 'A' Show 'AttrMap';

FillStyle = cats('GraphData', n);

LineStyle = cats('GraphData', n);

MarkerStyle = cats('GraphData', n);

TextStyleElement = cats('GraphData', n);

datalines;

F  2

M 1

 

;

run;

 

data test;

set sashelp.class;

if sex='F' then delete;

run;

 

ods listing close;

ods rtf file='c:\mytest.rtf';

 

proc sgplot data=test dattrmap=order ;

scatter x =height y = weight / group=sex attrid=A name="sct";

 

keylegend "sct" / noborder position=bottom ;

run;

ods rtf close;

ods listing;

1 ACCEPTED SOLUTION

Accepted Solutions
Jay54
Meteorite | Level 14

I ran your code using SAS 9.40M3, and it worked as expected.  The symbol for "F" was included inthe legend even though there is no "F" in the data.  Please make sure you have SAS 9.40M3 or later.

 

Show_Attrmap.png

 

View solution in original post

3 REPLIES 3
ballardw
Super User

I don't see where you have show = 'ATTRMAP'  in the code

 

If you are getting an error show the log with code and error in a code box opened with the forum {i} menu icon.

xpli
Calcite | Level 5

Hi,

 

show is a variable in dataset order.

it has the value "ATTRMAP'.

 

When later  attrmap=order is used in scatter plot, it should display the missing group in the legend.  

 

that is what I am expecting .  However, the missing group is not in lengend.

 

 

 

 

Jay54
Meteorite | Level 14

I ran your code using SAS 9.40M3, and it worked as expected.  The symbol for "F" was included inthe legend even though there is no "F" in the data.  Please make sure you have SAS 9.40M3 or later.

 

Show_Attrmap.png

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

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
  • 968 views
  • 0 likes
  • 3 in conversation