Skip to content

overlapping matplot

5 messages · Eliza Botto, Rui Barradas

#
Hello,

x <- matrix(rnorm(12), ncol = 2)
y <- matrix(rnorm(24), ncol = 4)

matplot(x, type = "l")
par(new = TRUE)
matplot(y, type = "l")


I see 6 lines, for 2 + 4 columns. If repeating colors are a problem, use 
argument 'col'.

Hope this helps,

Rui Barradas
Em 25-11-2012 14:37, eliza botto escreveu:
#
Or using matplot argument 'add'.

matplot(x, type = "l", ylim = range(c(x, y)))
matplot(y, type = "l", add = TRUE, col = 3:6)

Rui Barradas
Em 25-11-2012 15:07, Rui Barradas escreveu:
#
Hello,
Em 25-11-2012 15:17, eliza botto escreveu:
No, it's working for me, that's why I've sent it in my first answer. In 
your first post you had a typo, par(new-TRUE), maybe that's the reason why.

Rui Barradas