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
Kat
SAS Alumni
Hello,

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

CFC_SAS_Communities_400x225.jpg

Call for content now open!

It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.

Submit your proposal →

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