Plot bubble plot from data using for loop
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Pavel Sengupta
el 19 de Jul. de 2021
Comentada: Pavel Sengupta
el 20 de Jul. de 2021
I have a 84x4 table with columns class, p, h and time. I am trying to extract data one by one and plot using bubblechart so that it displays continuous like a movie. The code looks like the following given. But it does not work. Please suggest/help me.
for k=1:84
class1=class(k);
p=p(k);
h=h(k);
d1=time(k);
bubblechart(d1,h1,p1)
hold on
grid on
title(['p vs h at time = ',num2str(d1), 'days'])
pause(1)
end
0 comentarios
Respuesta aceptada
Walter Roberson
el 19 de Jul. de 2021
%let T be the table
for k = 1 : height(T)
bubblechart(T.time(1:k), T.h(1:k), T.p(1:k));
grid on
title("p vs h at time = " + string(T.time(k)) + " days")
pause(1)
end
3 comentarios
Walter Roberson
el 19 de Jul. de 2021
Maybe something like
T = readtable('p_vs_h test.xlsx')
class = T{:,1};
time = T{:,2};
p = T{:,3};
h = T{:,4};
for k = 1 : 14
bubblechart(time(k:14:end), h(k:14:end), p(k:14:end));
grid on
title("p vs h at time = " + string(time(k)) + " days")
pause(1)
end
Más respuestas (0)
Ver también
Categorías
Más información sobre Creating, Deleting, and Querying Graphics Objects en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!