How to set my 2 plots with the same y axis?

last = read.table("http://users.stat.umn.edu/~sandy/courses/8053/Data/Wichern_data/T1-6.dat", header=FALSE,col.names=c("x1", "x2","x3","x4","x5", "group"))

mu = filter(last, group == 1)

nonmu = filter(last, group == 0)
par(mfrow=c(1,2))
qqnorm(mu$x2, main="group: MS", ylab="x2", xlab = "")
qqnorm(nonmu$x2, main="group: NMS", ylab="x2", xlab = "", ylim=c(140,240))

Notice that the generated graph below, their height is not exactly the same. How to adjust?

Hello @Tung ,

with the code below they look the same to my inexperienced eye

library(dplyr)
last = read.table("http://users.stat.umn.edu/~sandy/courses/8053/Data/Wichern_data/T1-6.dat", header=FALSE,col.names=c("x1", "x2","x3","x4","x5", "group"))

mu = filter(last, group == 1)

nonmu = filter(last, group == 0)
par(mfrow=c(1,2))
qqnorm(mu$x2, main="group: MS", ylab="x2", xlab = "", ylim=c(140,240))
qqnorm(nonmu$x2, main="group: NMS", ylab="x2", xlab = "", ylim=c(140,240))

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.