1

I am trying to plot the GMM of my dataset using the Mclust package in R. While the plotting is a success, I do not want points to show in the final plot, just the ellipses. For a reference, here is the plot I have obtained:

GMM Plot

But, I want the resulting plot to have only the ellipses, something like this:

GMM desired plot

I have been looking at the Mclust plot page in: https://rdrr.io/cran/mclust/man/plot.Mclust.html and looking at the arguments of the function, I see there is a scope of adding other graphical parameters. Looking at the documentation of the plot function, there is a parameter called type = 'n' which might help to do what I want but when I write it, it produces the following error:

Error in plot.default(data[, 1], data[, 2], type = "n", xlab = xlab, ylab = ylab, : formal argument "type" matched by multiple actual arguments

For reference, this is the code I used for the first plot:

library(mclust)

Data1_2 <- Mclust(Data, G=15)
summary(Data1_2, parameters = TRUE, classification = TRUE)
plot(Data1_2,  what="classification")

The code I tried using for getting the graph below is:

Data1_4 <- Mclust(Data, G=8)
summary(Data1_4, parameters = TRUE, classification = TRUE)
plot(Data1_4,  what="classification", type = "n")

Any help on this matter will be appreciated. Thanks!

sumit808
  • 23
  • 4

1 Answers1

0

If you look under the source code of plot.Mclust, it calls plot.Mclust.classification which in turn calls coordProj for the dot and ellipse plot. Inside this function, the size is controlled by the option CEX= and shape PCH=.

So for your purpose, do:

library(mclust)
clu = Mclust(iris[,1:4], G = 3, what="classification")
plot(clu,what="classification",CEX=0)

enter image description here

StupidWolf
  • 45,075
  • 17
  • 40
  • 72