Chanti
Chanti

Reputation: 575

combine two plots in R . second plot is repalcing the first one

#qcc package(spc charts)
library(qcc)
A <- c(10,20,30)
B <- c(25,35,44)
par(mfrow = c(2, 1))
qcc(A,type="xbar.one")
qcc(B,type="xbar.one")

problem is : chart(B) is replacing chart(A) instead of positiong in the second row. someone please let me know how to overcome these problem

Upvotes: 2

Views: 996

Answers (1)

Cath
Cath

Reputation: 24074

There probably is a kind of bug and also, you need to use plot.

Here is a solution to make it work :

qA<-qcc(A,type="xbar.one")
qB<-qcc(B,type="xbar.one")  

par(mfrow=c(2,1))
plot(qA, restore.par=FALSE)
plot(qB)

The strange (probably bug?) part is that doing the below thing doesn't work... :

par(mfrow=c(2,1))
plot(qcc(A,type="xbar.one"),restore.par=FALSE)
plot(qcc(B,type="xbar.one"))

Upvotes: 6

Related Questions