I want to plot the Bayes decision boundary for a data that I generated, having 2 predictors and 3 classes and having the same covariance matrix for each class. Can anyone help me with that?
See the scripts for MASS chapter 12 here. The predplot function shows how to take a grid of posterior probabilities for each class and make a contour plot. It uses base graphics but you can make a better version using ggplot2 pretty easily
initially I thought you were right, but on second thoughts, Maria_s actually did give us the model, i.e., the data generating process, not just a data sample. By writing out that her data is conditionally normally distributed in each class, and that the covariance matrix is the same for each class, she's basically saying that the Bayes classifier (the classifier which minimizes the probability of misclassification) is LDA. See https://en.wikipedia.org/wiki/Linear_discriminant_analysis
but there's more than one thing you can do with a matrix, of course, and the function is not limited to any particular model. That's why I thought that the question should specify a reproducible example, called a reprex to see where the OP was stuck. There are times when it's reasonable to guess what the question is, but as posed, this one is more of a puzzle.
Did you find the answers useful? If you're still stuck, I'll try to write running code during the weekend. No promises though - I'm on a long business trip.