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: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 513 views
  • 0 likes
  • 2 in conversation