My goal is to:
- Create an invisible figure
- Using subplots, plot images on it, and then
- Save it without having it to open.
Thus, I am running the following code:
f = figure('Visible', 'off');
subplot(2, 2, 1), imshow(image1);
subplot(2, 2, 2), imshow(image2);
subplot(2, 2, 3), imshow(image3);
subplot(2, 2, 4), imshow(image4);
saveas(f, 'filename');
But I get the error:
Error using imshow (line xxx)
IMSHOW unable to display image.
This means that imshow is trying to display image. Is there a way to have imshow
display image in the invisible figure and not try to pop up?