Help using Base SAS procedures

boxplot fill color for blocking variable

Reply
N/A
Posts: 0

boxplot fill color for blocking variable

The code below produces a boxplot with the grouping variable of year. The grouping variable is displayed at the top of the graph where the fill in odd years in blue and no fill in the even years. How do I change the code so that a grey fill color is used in odd years and keep the no fill (or white) in even years? I tried the cblockvar= option for the block variable legend, but have not been able to change the color.
Thanks

proc boxplot data=precip_boxplot1;
plot precip*Watershed(year)/blockpos=1 blocklabelpos=above cblockvar= vminor=4 boxstyle=skeletal
nohlabel cboxfill=GRAYFF;
label year='Year'
precip='Precipitation (mm/yr)';
run;
Contributor
Posts: 74

Re: boxplot fill color for blocking variable

Posted in reply to deleted_user
check the options of cbox=(variable) and cboxfill=(variable) from the tech documentations. these will allow you to assign desired color and fill to a variable (years in your situation). you will need to create this color variable in your dataset precip_boxplot1.
Ask a Question
Discussion stats
  • 1 reply
  • 341 views
  • 0 likes
  • 2 in conversation