Updat GUI plot with new data
Show older comments
Dear all,
I have created a GUI that needs to update once a second in such a way that we see a moving wave. My code is triggerd by a Timer:
ind1 =obj.plot_Timestamp(1,1); % left boundary plot
ind2 =obj.plot_Timestamp(1,2); % right boundary plot
axes(obj.handle_GUI_1); %get acces to my GUI for ploting
plot(obj.x,obj.y1,'--r',obj.x,obj.y2,'b'); %plot a calculated wave and a forecasted wave
title('Wave Elevation [m]');
xlabel('Time [s]');
xlim([ind1 ind2]); % my left and right boundary to be shown in my plot changing every sec.
ylim([-2 2]);
legend('RAO','HSC');
drawnow;
When I start the simulation, the plot is created in my GUI but instead of updating my GUI it starts ploting in a new figure after the first update ( so after 1 sec I get a new figure with my moving wave opened on top of my GUI).
I have tried several things but nothing seems to help.
Anyone an idea how to fix this?
Thx in advanced
stijn
Accepted Answer
More Answers (0)
Categories
Find more on Annotations in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!