I am attempting to overlay boxplots over individual points on my scatterplot. However, I am having issues matching the axes on the two plots. Despite having the same number of elements (x axis) and value limit (y axis), the two axes of the two plots are scaled differently.
I am currently using:
plot((1:length(vec1)), vec1)
par(new=TRUE)
boxplot(mat2, names=c(1:length(vec1)))
Does anyone know of a way of ensuring that the plots are on the same scale without explicitly coercing the xlim and ylim? (the dimensions of vec1 and mat2 change on iterations).
vec1
andmat2
? – nrussell