Pass Two Handles to the same plot/Using 'animated line' with multiple axes in GUI
Show older comments
Hi, This is my first time posting a question because this database is so extensive that I always found already-posted-answers whenever I had a question. Anyway, I'm trying to generate two plots in the same GUI. I'm using 'animated line' to plot. I don't want to use 'plot'. My code looks like this:
h1=animatedline('Marker','o','LineWidth',1,'Color','k');
h4=animatedline('Marker','o','LineWidth',1,'Color','k');
............
axes(handles.liquid_compartment_graph);
addpoints(h1,t_liq,d10_liq);
drawnow
...........
axes(handles.solid_compartment_graph);
addpoints(h4,t_sol,d10_sol);
drawnow
However, the second addpoints command is also plotting in the first plot (handle-liquid_compartment_graph) which I'm guessing is happening because the second addpoint is only considering the handle h4 and not the one directing it to the particular axes. Can anyone please suggest what can I do to: 1. Either pass both the handles (the one for the axes and the other one for animated line)? 2. Or some other way to plot multiple animated lines in different axes in one GUI?
You'll save my life if you can come up with an answer. Thanks a lot in advance.
Accepted Answer
More Answers (0)
Categories
Find more on Animation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!