Save pictures in .pdf, .fig, and .jpeg with different paper orientation
조회 수: 4 (최근 30일)
이전 댓글 표시
Hello,
I have a question about saving the same pictures in different formats (.pdf, .jpeg, .fig) with diferent orientation.
%if true
A = readtable('RON.xlsx');
tempo_A = A{:,1:2:end};
[n,m] = size(A);
variavel_original = A{:,2:2:end};
var = {'Y1','Y2','Y3','Y4'};
guardar = {'Y1','Y2','Y3','Y4'};
guardar2 = {'YY'};
var_original = {'Y1','Y2','Y3','Y4'};
n_var = length(var);
for j=1:n_var
original=figure;
set(original,'PaperUnits','centimeters','PaperPosition',[0 0 29 21],'PaperOrientation','landscape');
plot(tempo_A(:,j),variavel_original(:,j),'-b*');
for i=1:n
text(tempo_A(i,j),variavel_original(i,j),num2str(i),'Color','b','FontSize',8,'VerticalAlignment','top');
end
title(var(j));
grid on
xlabel('tempo');
ylabel('Y');
legend(var_original(j),'Location','best','Orientation','vertical');
saveas(original,fullfile('C:\Users\TiagoAlexandre\Documents\MATLAB\GALP\RON\Originais', guardar{j}), 'fig');
saveas(original,fullfile('C:\Users\TiagoAlexandre\Documents\MATLAB\GALP\RON\Originais', guardar{j}), 'jpeg');
saveas(original,fullfile('C:\Users\TiagoAlexandre\Documents\MATLAB\GALP\RON\Originais', guardar{j}), 'pdf');
end
% code
%end
So, in the set command I choose the option landscape, it creates a pdf file landscape of size almost A4 it's ok for the purpose.
Question 1 -> I wanted to save the jpeg file as 'portrait', how would I do that? (i want the jpeg file the same way as the pdf file, (the plot left to right). Question 2 -> I would want to save the .fig file a bit bigger, like a maximize window.
Thanks for your time, Tiago
댓글 수: 3
Manan Mishra
2018년 1월 11일
Glad that you figured it on your own.
It would be beneficial for the community in future if you can share your solution in the answers section.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Printing and Saving에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!