BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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;
1 REPLY 1
abdullala
Calcite | Level 5
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.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1749 views
  • 0 likes
  • 2 in conversation