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;
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
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
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 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.