I have a timeseries I call x_matrix that is 45x100 as in 45 variables at 100 different time steps. I wrote a function I call plot_network that takes any column of x_matrix and plots a directed Graph in a figure. I would like to plot all time steps one after the other so I try this:
for t=1:length(x_matrix)
plot_network(x_matrix,t)
end
However since the plot_network includes these lines:
figure
p = plot(G)
G being the graph I build with edges from data in x_matrix (unrelated to this question)
The above for loop gives me 100 figures, I would like to have just one figure but the plot gets updated. As in an animation where the first time step is plotted then deleted from the figure and the following time step gets plotted in the same figure.
Any help is appreciated!
plot_networkshould either get a handle of axes data to update or output the data to be updated in the graph. - EBH