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

I have in PROC SGPLOT v9.4

styleattrs datacontrastcolors=(CXE41A1C CX377EB8 CX4DAF4A CX984EA3 CXFF7f00 CXFFFF33 CXA65628)
datasymbols=(diamond star circle triangle square triangleleft triangleright);

for 7 trials and I append filler data so every plot uses every trial, but for some trials not available the data is only outside the plot boundary. How can that data be ignored in plotting?

Is this the best solution, as all trials appear in the legend even if only 3 have data?  Ideally only those with data will be in legends, but with consistent attributes from plot to plot (inside a macro, one call per plot).

 

yaxis min=0.01; so filler data not used, but there. 


data filler;
Trial = 'A1'; &y. = 0.0001; &x. = 0; MeanY = 0.0001; output;
Trial = 'A2'; &y. = 0.0001; &x. = 0; MeanY = 0.0001; output;
Trial = 'Ag'; &y. = 0.0001; &x. = 0; MeanY = 0.0001; output;
Trial = 'Cg'; &y. = 0.0001; &x. = 0; MeanY = 0.0001; output;
Trial = 'DZ'; &y. = 0.0001; &x. = 0; MeanY = 0.0001; output;
Trial = 'Ms'; &y. = 0.0001; &x. = 0; MeanY = 0.0001; output;
Trial = 'Rs'; &y. = 0.0001; &x. = 0; MeanY = 0.0001; output;
run;

1 ACCEPTED SOLUTION

Accepted Solutions
djrisks
Barite | Level 11

Hello, in order to get consistent attributes from plot to plot regardless of how many trials you have, you should use Discrete Attribute Maps.

 

Here is an example of how to use Attribute Maps.

 

https://blogs.sas.com/content/graphicallyspeaking/2013/04/02/attribute-maps-1/

 

Regards,


Kriss

View solution in original post

2 REPLIES 2
djrisks
Barite | Level 11

Hello, in order to get consistent attributes from plot to plot regardless of how many trials you have, you should use Discrete Attribute Maps.

 

Here is an example of how to use Attribute Maps.

 

https://blogs.sas.com/content/graphicallyspeaking/2013/04/02/attribute-maps-1/

 

Regards,


Kriss

huph
Calcite | Level 5

Thanks Kriss! And even easier in 9.4. I got halfway changing my fake data y values to missing, but this is better!

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 25. 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
  • 2 replies
  • 428 views
  • 0 likes
  • 2 in conversation