Skip to content
Prev 306054 / 398506 Next

efficient overlapping average curve on original curves

On Sep 21, 2012, at 4:11 PM, eliza botto wrote:

            
If you are going to use par(new=TRUE) you must make sure your 'xlim' and 'ylim' are the same in the second plot as in the original plot. In your misadventure, the ylim for the means was probably much more narrow than in the original data. Or to do it easily, follow Rui Barradas' advice.

Or you could `rbind` the `rowMeans` to the original data before using `matplot`.
Perhaps:

matplot(x=mat1, y= rbind(mat2, rowMeans(mat2) ) )