I am trying to assign different symbols to each Temp but I couldn't find a means to do it.
I have 4 temp levels;
This is my code.
proc sgpanel data=EECreduced ;
panelby MC / spacing=5 novarname ;
vline day/ response= ECC group=Temp stat=mean markers limitstat=stddev markerattrs=(symbol=plus size=3) ;
run;
My thinking
from markerattrs= (symbols= plus..) (I should be able to add another code to pick the first temp for plus, second temp arrow down ..etc
I attached s sample plot fr your perusal
Thanks
I would suggest raising the issue with SAS Support team as the example in the blog post does not work for me using SAs 9.4.
Perhaps they changed something in 9.4?
If you run this code the same symbol is used for both lines which looks like the issue you are seeing.
proc sgplot data= sashelp.class;
title 'Using the STYLEATTRS statement in SAS 9.4';
styleattrs
datacontrastcolors=(orange purple)
datalinepatterns=(1)
datasymbols=(circlefilled trianglefilled)
;
reg x=weight y=height / group=sex degree=3;
run;
But the SAS log has a note about using the ATTRPRIORITY setting.
So adding this line before the PROC SGPLOT makes it work.
ods graphics / attrpriority=none;
Assuming you're using SAS 9.4+ I would recommend the STYLEATTRS statement.
Blog with usage example
http://blogs.sas.com/content/sgf/2014/05/30/assigning-graph-style-attributes-easily/
Documentation
Thank you so much for your very helpful response. I appreciate it so much!!.
I am using sas studio online at home and sas 9.4 in school.
My response is based on the sas studio online
I modified the code as follows
proc sgpanel data=EECreduced ;
styleattrs datacontrastcolors=(orange black green red) datalinepatterns=(1)
datasymbols=(circlefilled trianglefilled rectanglefilled sqaurefilled);
panelby MC / spacing=5 novarname ;
vline day/ response= ECC group=Temp stat=mean markers limitstat=stddev ;
run;
Summary
The colour of each line changed but the symbols remain.
Please see attached
Thank you
I would suggest raising the issue with SAS Support team as the example in the blog post does not work for me using SAs 9.4.
Perhaps they changed something in 9.4?
If you run this code the same symbol is used for both lines which looks like the issue you are seeing.
proc sgplot data= sashelp.class;
title 'Using the STYLEATTRS statement in SAS 9.4';
styleattrs
datacontrastcolors=(orange purple)
datalinepatterns=(1)
datasymbols=(circlefilled trianglefilled)
;
reg x=weight y=height / group=sex degree=3;
run;
But the SAS log has a note about using the ATTRPRIORITY setting.
So adding this line before the PROC SGPLOT makes it work.
ods graphics / attrpriority=none;
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Early bird rate extended! Save $200 when you sign up by March 31.
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.