Changing Individual Box Colors in a Box Plot

Changing Individual Box Colors in a Box Plot

by Rashed -
Number of replies: 0

Hello all, 

We received many questions regarding how to change individual colors in a box plot, and Kristen was able to find the command: you would need to add asyvars to the end of the box plot command to assign a different color to each category. 

Example:

graph box age, over(sex) asyvars ///
bar(1, color(orange)) ///
bar(2, color(green))


Note: The second and third lines of the commands starting with bar refer to assigning each bar a specific color. 

Let us know if you have any questions!

Rashed