Hi I need to plot a rectangle in R. I have two matrices a and b. I have created a boxplot for a and want to create a boxplot for b on the same plot for a . Matrix boxes b must lie on the mustache boxplot for a .
a
b
Is there a way to do this in R ??
To add a rectangle to an existing plot, just use an argument add=TRUE , namely:
add=TRUE
##Some data a = rnorm(20) b = rnorm(20, 2, 0.3) ##The plots boxplot(a) boxplot(b, add=TRUE, col=2)