R: Plotting 2 Matrices in one plot -



R: Plotting 2 Matrices in one plot -

i have 2 matrices follows:

m1:

fy1301 fy1302 fy1303 fy1304 fy1305 fy1306 146 56 159 129 54 535 137 113 337 140 160 777 281 111 331 198 231 875 273 55 480 205 356 887

m2:

fy1301 fy1302 fy1303 fy1304 fy1305 fy1306 34 5 99 82 121 180 89 98 252 33 311 310 101 77 252 45 284 265 170 64 125 33 187 288

i trying plot both matrices on same plot.

what doing giving me 2 different plots. next code:

par(mar=c(5.1, 4.1, 4.1, 8.1), xpd=true) matplot(m1, type = c("b"), pch = 1, col=1:6, xlab = "month", ylab = "total sessions med1") legend("topright", legend = c("fy13 01","fy13 02","fy13 03","fy13 04","fy13 05","fy13 06"), inset=c(-0.11,0), col=1:6, pch=1, cex = 0.5, bty = "n") par(mar=c(5.1, 4.1, 4.1, 8.1), xpd=true) matplot(m2, type = c("b"), pch = 1, col=1:6, xlab = "month", ylab = "total sessions without med1") legend("topright", legend = c("fy13 01","fy13 02","fy13 03","fy13 04","fy13 05","fy13 06"), inset=c(-0.11,0), col=1:6, pch=1, cex = 0.5, bty = "n")

since comparing 2 plots, looking plot both matrices in 1 single plot. (the matrices m1 , m2 outputs of code)

what modifications need current code?

thanks lot!!!

try:

par(mar=c(5.1, 4.1, 4.1, 8.1), xpd=true) matplot(m1, type = c("b"), pch = 1, col=1:6, xlab = "month", ylab = "total sessions med1") legend("topright", legend = c("fy13 01","fy13 02","fy13 03","fy13 04","fy13 05","fy13 06"), inset=c(-0.11,0), col=1:6, pch=1, cex = 0.5, bty = "n") par(new = true) matplot(m2, type = c("b"), pch = 1, col=1:6, xlab = "month", ylab = "total sessions without med1") legend("topright", legend = c("fy13 01","fy13 02","fy13 03","fy13 04","fy13 05","fy13 06"), inset=c(-0.11,0), col=1:6, pch=1, cex = 0.5, bty = "n")

r plot visualization

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

java - Parsing XML, skip certain tags -

c# - ASP.NET MVC Sequence contains no matching element -