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;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.