Hello,
I have four files with ten columns of data. They have common x-axis, array of t.
I am plotting them using for loop
The code looks something like below;
For i=1:10
figure(1)
handle1(i)=plot(t(:,1), File1(:,i));
Legend1{i}=sprintf('Run number: %d',i);
hold on
figure(2)
handle1(i)=plot(t(:,1), File2(:,i));
Legend2{i}=sprintf('Run number: %d',i);
hold on
figure(3)
handle3(i)=plot(t(:,1), File3(:,i));
Legend3{i}=sprintf('Run number: %d',i);
hold on
figure(4)
handle4(i)=plot(t(:,1), File4(:,i));
Legend4{i}=sprintf('Run number: %d',i);
hold on
end
legend(handle1,Legend1, ‘location’, ‘northwestoutside’);
legend(handle2,Legend2, ‘location’, ‘northwestoutside’);
legend(handle2,Legend2, ‘location’, ‘northwestoutside’);
legend(handle2,Legend2, ‘location’, ‘northwestoutside’);
Now, saving figure after legend will reduce the figure aspect ratio. I would like to save figure in full-screen mode.
i.e.saveas(figure(2), ‘Figure2.tiff’,’Tiff’);
I did some search and found the following code
FigH = figure('Position', get(0, 'Screensize'));
F = getframe(FigH);
I am unable to figure out as to how I can incorporate figure number inside above-mentioned command. i.e. inside figure(‘position’, get(0,’Screensize’))
I am learning matlab now. I also welcome any additional comment on the code itself.
Best Answer