How can I get .EPS output using yyaxis and for function?
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Muhammad yahya
am 14 Mai 2017
Kommentiert: Muhammad yahya
am 17 Mai 2017
Hi, I am encountering an issue regarding taking extracting out the figure after using yyaxis. Although, I am able to extract the figure in .pdf format, this puts the whole page when putting in latex. I can use trim function in latex, but that would not be economical. I tried different ways of extracting output in the form of eps, but none works.
cd 'D:\Matlab\Article\Graphs'
for i=1:20
yyaxis right
plot(dates,prices(:,i));
ylabel('Price','interpreter','latex', 'FontSize',10, 'FontName','Times')
yyaxis left
plot(dates,returns(:,i));
ylabel('Return', 'interpreter','latex', 'FontSize',10, 'FontName','Times')
set(gca, 'FontName', 'Times')
print(sprintf('tsline_%d.pdf', i), '-dpdf', '-bestfit');
end
I used the above given function to extract .pdf.
I am using on one y-axis the price series and the return series on the other and the x-axis constitutes of dates. I have twenty columns for each series and number of observations are 7825. To extract in eps, I used the following function:
cd 'D:\Matlab\Article\Graphs'
for i=1:20
yyaxis right
plot(dates,prices(:,i));
ylabel('Price','FontSize',8)
yyaxis left
plot(dates,returns(:,i));
ylabel('Return', 'FontSize',8)
saveas(gcf,strcat('figure',num2str(i),'.eps'));
i = i+1;
end
However, this gives me just the firs graph output and then stops and returns error of insufficient java memory and error in saveas (line 168). print(h, name, ['-d' dev{i}] ). I changed the saveas to print as well, but the problem persists.
I would really appreciate any sort of help.
Many Thanks. :)
Yahya
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 14 Mai 2017
3 Kommentare
Walter Roberson
am 15 Mai 2017
Sorry, I do not know of faster methods -- at least not if you want vector output.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Display Image finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!