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

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 1284 views
  • 0 likes
  • 2 in conversation