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