I am using MATLAB for my data analysis. In my scripts I create figures with fit results so that I can quickly play with fit parameters and see how they change my end results.
My question is whether there is a simple way to be able to just refresh my figures along with subplots and annotations without losing the positions and sizes of the subplots and annotations. I.e.: I would like to be able manually position my figures on my workspace (I use Linux), manually adjust figure size/position, subplot sizes/positions and annotation sizes/positions and then have their content update, when I rerun the script that does my fitting.
I do realize that the command figure(...) does this nicely and it works, but I am having the problem, that when I resize/move subplots and move annotations, that they're sizes/positions get lost, when I rerun the script.
I am aware that I probably need to use the subplot/annotation handles for this but the question is, what the most elegant and simple way is to do this? Since I need the code to also work when run the first time (i.e. no figures/subplot/annoations yet existent), will I need a lot of if-clause, to check if the handles already exist?
I've been using MATLAB for quite some time and for almost equally long it's been bothering me that I don't know an elegant way to do this!