BookmarkSubscribeRSS Feed
Robert_des_Bois
Calcite | Level 5
Hello,

I'm trying to use the cboxfill option with a variable name containing rigth color names within the boxplot procedure but it doesn't want to color them ...

Even if I define the "couleur" variable with "RED" everywhere, it's doesn't work too ... But if I replace cboxfill=couleur by cboxfill=red, all plots are logically red.

Do you have an idea ?

Best wishes,

Marc

Here is my code :


DATA dessin; SET sites.pc_value_sel;
length couleur $8.;
Select (km7b);
when (1) couleur="RED";
when (2) couleur="GREEN";
when (3) couleur="BLUE";
when (4) couleur="BLACK";
when (5) couleur="orange";
when (6) couleur="magenta";
when (7) couleur="brown";
Otherwise;
end;
RUN;

PROC SORT DATA=dessin; BY km7b;

Proc boxplot data=dessin;
plot (H6210_t) * km7b
/ caxis=BLACK
cframe=CXA8A8A8
ctext=BLACK
cboxes=black
cboxfill=couleur
idcolor=black
boxstyle=schematicid
WAXIS=1
haxis=axis1;
run;
1 REPLY 1
Kat
SAS Employee Kat
SAS Employee
Hello,

Put the variable name in parenthesis:
cboxfill=(couleur)

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

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