How can I get .EPS output using yyaxis and for function?
Mostrar comentarios más antiguos
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
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Display Image en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!