Matlab: Plot line on a particular figure
<p>Is there a way to specify that a line should be plotted on a particular figure.
I am running a code, which at various points draws stuff on multiple figures. Everythings works fine if i do not interact with matlab while the code is running. </p>

<p>The problem is, I switch between matlab figures (manually to check results) while matlab is running which sometimes causes matlab to plot stuff on wrong figure.
I am calling "figure(fig_handle)" just before doing the plotting but still matlab sometimes draws stuff on wrong figure. Does anyone have a solution ?</p>