Why isn't animatedline showing a line plot?
Show older comments
Hi, I'm trying to plot an animation with 4 subplots. It is working fine except that the plots only show up if I put in a marker, not just a line.
Here is the code - can anyone advise as to how to get lines to show?
load dfRH;
load xxout;
seq = 1:6:1418;
SimT = xxout(seq,3)-273.15;
ACH = csvread('ACH_AO_1000.csv');
IAS = csvread('IAS_AO_1000.csv');
ACH_mean = mean(ACH,2)*9+1;
IAS_mean = mean(IAS,2)*0.75+0.1;
figure('WindowStyle','docked');
for k = 1:100
subplot(1,4,1)
title('Relative Humidity Data');
xlabel('timestep');
ylabel('Relative Humidity (%)');
h1 = animatedline('Marker','.','Color','b');
xlim([1,100])
ylim([0,100])
x = k;
y1 = dfRH(k,1)*100;
addpoints(h1,x,y1);
pause(0.05)
drawnow
subplot(1,4,2)
title('Ventilation Rate');
xlabel('timestep');
ylabel('Ventilation Rate (ACH)');
h2 = animatedline('Marker','o','Color','k');
xlim([1,100])
ylim([0,10])
y2 = ACH_mean(k);
addpoints(h2,x,y2);
pause(0.05)
drawnow
subplot(1,4,3)
title('Internal Air Speed');
xlabel('timestep');
ylabel('Internal Air Speed (m/s)');
h3 = animatedline('Marker','x','Color','k');
xlim([1,100])
ylim([0,1])
y3 = IAS_mean(k);
addpoints(h3,x,y3);
pause(0.05)
drawnow
subplot(1,4,4)
title('Temperature');
xlabel('timestep');
ylabel('Temperature (^oC)');
h4 = animatedline('Marker','.','Color','r');
xlim([1,100])
ylim([0,30])
y4 = SimT(k);
addpoints(h4,x,y4);
pause(0.05)
drawnow
end
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!