Making a .gif from a for loop of plotted images
37 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have a few questions but first here is my code:
[file_list, path_n]=uigetfile('.csv','Grab the files you want to process','Multiselect','on')
if iscell(file_list) == 0
file_list = (file_list);
end
N = length(file_list);
for i = 1:N
filename = file_list{i};
data_in = xlsread([path_n filename])
hold on
depth = data_in(:,1);
Axial_stress = data_in(:,2);
plot(depth, Axial_stress)
xlabel('cm')
axis auto
ylabel('kbar')
legend(filename)
drawnow
end
The overall goal is to make a .gif (if possible, otherwise the drawnow function will work) of the different graphs that are coming from this data but I have a few questions
- How do i choose the colors for the lines? Any sort of line color choice function didnt seem to work for me, maybe I am missing something simple
- Is it possible to diplay the currently plotting graph in the legend then once all the graphs are plotted, have a "total" graph that has all the lines in the legend?
- How can I extract only the last 8 characters of the filename to use for the legend?
- How can i have the x axis min be set, but let the x axis max and y axis min and max be floating and not dependant on the first file in my for loop?
0 comentarios
Respuestas (2)
Image Analyst
el 16 de Abr. de 2021
See if you can find something similar in a search of the forum:
Or the blogs and file exchange:
0 comentarios
Image Analyst
el 16 de Abr. de 2021
To make a movie of the plots, see my attached demo.
0 comentarios
Ver también
Categorías
Más información sobre Graphics Performance en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!