data:
V D1 D2 D3 CS1 CS2 CS3 10 2038 1806 1643 72.81171847 64.52304394 58.69953555 20 550 709 757 92.46159343 89.85351911 85.7449089 30 142 192 271 97.53483387 96.71311183 95.42693819 40 45 61 80 99.14255091 98.89246159 98.28510182 50 12 20 30 99.57127546 99.6070025 99.35691318 60 5 6 10 99.74991068 99.82136477 99.71418364 70 2 2 3 99.82136477 99.89281886 99.82136477 80 4 1 2 99.96427295 99.92854591 99.89281886 90 1 0 1 100.0000000 99.92854591 99.92854591 100 0 1 0 100.0000000 99.96427295 99.92854591 script:
mp<-barplot(as.matrix(t(df[,2:4])),beside=TRUE,xlim=c(0,40),ann=FALSE) mp [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] 1.5 5.5 9.5 13.5 17.5 21.5 25.5 29.5 33.5 37.5 [2,] 2.5 6.5 10.5 14.5 18.5 22.5 26.5 30.5 34.5 38.5 [3,] 3.5 7.5 11.5 15.5 19.5 23.5 27.5 31.5 35.5 39.5 par(new=TRUE) plot(mp[2,],df$CS1,xlim=c(0,40),type="l",col="red",axes=FALSE,ylim=c(0,100),ann=FALSE) lines(mp[2,],df$CS2,col="blue") lines(mp[2,],df$CS3,col="green") axis(1,at=mp[2,],labels=df$V) axis(4,at=seq(0,100,10)) creates this
If you look to the picture, the Y-axis are shifted to each other. How to make that the 0 of both Y-axis are on the same height?



