I've got a script that produces some plots. It's nothing fancy. I haven't included all the variable definitions in the code snippet below because they're not important. But you can see, I'm just using subplot and plot to make a bunch of plots.
If I just consider one loop (for jj = 1:1) I get the following set of plots.
If I allow jj to advance to 2 (for jj=1:2) I get this next set of images. Notice that the bottom plot in the first column is changed (and the axes go all whacky) but the second loop didn't change any of the first column plots.
Finally, if I let jj advance to 3 (for jj=1:3) The bottom plot in the middle column also gets ruined.
Now, here's the really weird part. If I change jj by hand and then copy/paste the same commands from the script editor into the interpreter I don't see any odd behavior at all. New columns are added and previous columns remain unchanged. I'm attaching the 'fig' file for the last plot as well as a snippet of the code I'm using.
Thanks in advance for anyone that can give me a workaround or (better yet) a solution!
I saw the same behavior in 2017b and 2018a. I'm using Windows 10 64-bit on an AMD Threadripper cpu.
for jj = 1:1