I will answer this question myself. Docking the figure pretty much solves my problem.
Just run
set(0,'DefaultFigureWindowStyle','docked')
And the figure window will be docked in MATLAB main GUI instead of popping up.
See this page for more details: http://www.mathworks.com/help/matlab/creating_plots/docking-figures-in-the-desktop.html