Hi guys, I'm trying to write some code to periodically update a plot with multiple 'Ydata' sets without losing focus on the current window i'm working on (i.e. Word, Chrome etc…).
At the moment I perform the calculations on the data then update the plot with a for loop in the following manner:
for...figure(h); plot(t_whole,'-k'); hold on plot(fit.mode,'-b'); plot(fit.mean,'-r'); axis tight drawnow hold offend
This works to update the plot but then steals the focus back to the figure each time the plot is updated (approx every 6-12s depending on the data set)
Ideally I would want to use
set(h,'YData',...);
which wouldn't steal focus, but i'm not sure how to do that for the 3 data sets I have (t_whole,fit.mode,fit.mean). Any suggestions?
Thanks, Allen
Best Answer