I'm using RStudio and I keep trying to use plot_grid to create my multiclass ROC graphs, but I keep getting the error: "cannot convert object of class roc to grob." Additionally, each of the legends disappear when plot is called.
Not sure how plot.grid works but there is an alternative using the "layout" function which I think is much better and flexible. As opposed to "plot.grid". Use it before calling your plots.
In your case using "layout(matrix(1:9),nrow=3,byrow=T)" then calling your seven plots should work but you'll have to add the subplot labels by yourself with text(..., xpd=T). Now R has setup a 3x3 multipanel figure of this shape:
1 2 3
4 5 6
7 8 9
Plots have be called in the order of the numbers in the matrix given to "layout", such that in the multipanel figure the first plot you call will appear where the 1 is (i.e. topleft here), etc. If you don't call any 8th or 9th plot you will obtain what you are searching for. Since you are not plotting 9 figures here, don't forget to call par(mfrow=c(1,1)) after the 7th plot to stop the multipanel figure, so if you make another plot after it won't appear in the multipanel figure.
The nice thing with layout is that you can make irregular multipanel plots, for instance if you want the seventh plot to fill the whole figure width, you could call: layout(matrix(1:6,7,7,7),nrow=3,byrow=T).
If the problem comes from earlier than the call of plot.grid this won't help. For sure, in at least R v4+ the "add" argument is not available for the "plot" function. Instead of using:
plot(x,y,col='red',lty=3,add=T)
Use:
lines(x,y,col='red',lty=3)
This will automatically add the line on the current plot.