correct figure size using print eps R2012a

Hi All,
I have done a search and can't find the solution to a pretty simple problem. I want to save figures using the print function, but the dimensions of the figure gets funky when I try to save in eps. I need to use eps for publishing.
Here is an example of a simple data set with the code I use to print the figure
x=[0:50];
y=sin(x);
yE=rand(1,51)/10;
close all
figure(1)
axes('FontSize',10)
errorbar(x,y,yE,'-o','markerfacecolor','b')
xlabel('x','FontSize',12)
ylabel('y','FontSize',12)
set(gcf,'Units','inches','PaperUnits','inches')
set(gcf,'PaperPositionMode','auto')
set(gcf,'Position',[0 0 4.5 3.39])
print(gcf,'-depsc','test.eps')
here is the figure if I use file- save as in the figure:
Here is the image saved using the print(gcf,...) command:
Both figures above were was saved as .eps but had to convert to .jpg to upload here. Also, to highlight the change in figure size I added a black box around the edge of the image.
adding '-loose' did not fix the problem for me. I am using linux (scientific linux 6.7)
Thanks,
Casey

답변 (0개)

카테고리

도움말 센터File Exchange에서 Printing and Saving에 대해 자세히 알아보기

질문:

2016년 2월 19일

편집:

2016년 2월 19일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by