When you say 120-off figures:
- Are these matlab figures .fig?
Also, see the code below that was used to create what is known as a matlab subplot . In this example I've created a grid of 32 subplots and it's barely readable. - Are you sure you want to use a subplot for all of the 120 figures?
- Or 120 figures to be plotted in one graph?
NrOfSubPlots = 32;
PlotGridX = 8;
PlotGgridY = NrOfSubPlots/PlotGridX;
f(1) = figure;
subplot(PlotGridX,PlotGgridY,1);
scatter(rand([1,10]),rand([1,10]));
hold on
for i=2:NrOfSubPlots
subplot(PlotGridX,PlotGgridY,i);
scatter(rand([1,10]),rand([1,10]));
end
savefig(f(1),'32plots.fig')
Output:
The code below shows how to save figures to a .fig file and the read them back to Matlab and to the subplot:
NrOfSubPlots = 10;
for i=1:NrOfSubPlots
f(i) = figure;
scatter(rand([1,10]),rand([1,10]));
name = ['fig' num2str(i) '.fig']
savefig(f(i),name)
end
close(f)
clear f i name;
FigsInTheFolder = dir('*.fig');
HowMany = numel(FigsInTheFolder);
newF = figure;
for i = 1:HowMany
newF(i) = openfig(FigsInTheFolder(i).name,'invisible');
end
showF = figure;
for i = 1:HowMany
h(i) = subplot(1,HowMany,i);
copyobj(allchild(get(newF(i),'CurrentAxes')),h(i));
end
4 Comments
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/393846-how-to-save-120-figures-in-a-folder-defined-by-user-and-later-retrieve-it#comment_555067
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/393846-how-to-save-120-figures-in-a-folder-defined-by-user-and-later-retrieve-it#comment_555067
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/393846-how-to-save-120-figures-in-a-folder-defined-by-user-and-later-retrieve-it#comment_555073
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/393846-how-to-save-120-figures-in-a-folder-defined-by-user-and-later-retrieve-it#comment_555073
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/393846-how-to-save-120-figures-in-a-folder-defined-by-user-and-later-retrieve-it#comment_555096
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/393846-how-to-save-120-figures-in-a-folder-defined-by-user-and-later-retrieve-it#comment_555096
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/393846-how-to-save-120-figures-in-a-folder-defined-by-user-and-later-retrieve-it#comment_555115
Direct link to this comment
https://it.mathworks.com/matlabcentral/answers/393846-how-to-save-120-figures-in-a-folder-defined-by-user-and-later-retrieve-it#comment_555115
Sign in to comment.