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.

sas-innovate-2024.png

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.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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