If I try to call multiple figures in a script and then update them afterwards by adding a title or plotting on top of them I get weird seemingly random behavior. For example:
figure(1) imshow(myimage, []) figure(2) imshow(myimage2, []) hold on plot(x,y)
When I run this the plot after the `hold on` shows up on top of figure(1). I am running Matlab on Ubuntu, my office mate running Matlab on OSX tested my code and on his machine it runs the way you would expect, plotting ontop of figure 2.
I've also experienced similar issues when trying to do something like:
figure(1) imagesc(myheatmap) title('Title 1') figure(2) imagesc(myheatmap) title('Title 2')
In this example the titles may or may not be swapped. I don't understand how to control this behavior to get the desired output but it really ruins some scripts for me. Any help is appreciated.
Best Answer