How to change colours in boxplot
proc template;
define statgraph classbox;
begingraph / designwidth=700px designheight=450px backgroundcolor=CXE8E6E8;
layout overlay;
boxplot y=&var1 x=tmt/group=ANALYTE_FULL name='box' ;
endlayout;
endgraph;
end;
run;
Are you sure you want to do this at template level?
Why not just change the color directly in an SGPLOT Procedure? You can control the colors of the individual parts like this
proc sgplot data=sashelp.heart;
vbox cholesterol / category=deathcause fillattrs=(color=green)
lineattrs=(color=black)
whiskerattrs=(color=blue)
meanattrs=(color=red)
medianattrs=(color=red)
outlierattrs=(color=purple);
run;
Both what? What do you want to change?
Hi,
Please let know which part of Box need a Color update is required.
I think you are asking about changing the colors that are associated with the groups in the GROUP= option.
You can use the STLEATTRS statement to set those values.
See
or if you are not using SAS 9.4, see
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.