I am trying to mark outliers on a QQ graph in a Chi square using mvOutlier()the batch function MVNin R.
I was able to identify outliers by their labels and get their x coordinates. I tried to place the first on the chart with text(), but the x- and y-coordinates seem to be inverted.
Based on an example from the documentation:
library(MVN)
data(iris)
versicolor <- iris[51:100, 1:3]
result <- mvOutlier(versicolor, qqplot = TRUE, method = "quan")
labelsO<-rownames(result$outlier)[result$outlier[,2]==TRUE]
xcoord<-result$outlier[result$outlier[,2]==TRUE,1]
text(xcoord,label=labelsO)
This gives the following:

I also tried text(x = xcoord, y = xcoord,label = labelsO), which is fine when the points are near the line y = x, but can fail when the normality fails (and the points deviate from this line).
Can anyone suggest how to access the Chi-square quantiles or why the x coordinate of the function text()does not seem to obey the input parameters.