MATLAB: Imrect not visible after updating an image

Image Processing Toolboximrect

Refer to the script below:
f = figure;
im = image(rand(200, 100, 3));
roi = imrect(gca, [5, 10, 40, 30]);
title('ROI visible');
pause;
hold('on');
image(rand(200, 100, 3));
title('ROI not visible, how to make it visible again?');
At this point, roi still exists but is no longer visible. You can still run get(roi), for instance. How to make it visible again?
Thanks!

Best Answer

uistack(roi, 'top')