As of the current Matlab release (R2021b), it is not possible to control the uistack of objects on different sides of a yyaxis. Objects assigned to the right axis will always be on top.
Alternative work-arounds
- Move the red bars to the left y-axis and the green/blue bars to the right axis.
- Use plotyy instead (but yyaxis is still much better). See this answer.
- Use transparency to see overlapping bars. See FaceAlpha and EdgeAlpha properties of bar objects.