필터 지우기
필터 지우기

Unable to save full size image in eps format in matlab?

조회 수: 1 (최근 30일)
Abhik Saha
Abhik Saha 2021년 1월 17일
편집: Abhik Saha 2021년 1월 18일
I am using the R2017a version of the matlab. I generate a plot and then when I try to save using print command then in the output file there are some white spaces appear. How I will get the full size image as in the matlab figure window as well as the output file? I am writing below the code which I am trying
set(gcf, 'Position', get(0, 'Screensize'));
h = axes('Position',[0.15,0.15,0.5,0.6]);
contour(h,z0,U1,merit_psd,[0.95,0.95],'k-','LineWidth',3);
print(1,'-depsc2','filename.eps');
  댓글 수: 2
Matt Gaidica
Matt Gaidica 2021년 1월 17일
편집: Matt Gaidica 2021년 1월 17일
It would help to include an image of the issue and data so we can replicate it. I don't have any 'white spaces' for the following code:
x = linspace(-2*pi,2*pi);
y = linspace(0,4*pi);
[X,Y] = meshgrid(x,y);
Z = sin(X)+cos(Y);
contour(X,Y,Z)
print(1,'-depsc2','filename.eps');
Abhik Saha
Abhik Saha 2021년 1월 18일
편집: Abhik Saha 2021년 1월 18일
Thank you for the reply. This is ok and it also works fine. But if I want to get a picture like this (attached). then there is a white spaces. I am attaching the code and the image file. i am attaching the fig file and the screenshot of eps file in png format since eps format is not supported. You can see there are white spaces in the upper side of the figure.
x = linspace(-2*pi,2*pi);
y = linspace(0,4*pi);
[X,Y] = meshgrid(x,y);
Z = sin(X)+cos(Y);
Z1=sin(X)+cos(Y);
h = axes('Position',[0.15,0.15,0.49,0.25]);
contour(h,X,Y,Z)
h = axes('Position',[0.73,0.15,0.25,0.25]);
contour(h,X,Y,Z1)
print(1,'-dpdf','filename.pdf');

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by