필터 지우기
필터 지우기

Saveas: missing half the figure!?

조회 수: 8 (최근 30일)
Kellen
Kellen 2013년 7월 9일
I have three axes on a single figure. For each one, I manually set the position instead of using subplot. When I save the file using:
saveas(gcf,fileName,'pdf');
the figure saves, the orientation (portrait/landscape) is maintained, and the figure dimensions are preserved, BUT the content of the image is messed up (see attached figure). This only happens sometimes, other times it works just fine doing very similar plotting.
QUESTION: Why is this happening and how do I avoid it without making my life too much more difficult.
Here are some bits and pieces of my code:
% Setup size and orientation to be that of a landscape letter paper
figure(ifig)
set(gcf,'DefaultAxesFontSize',fontsize,'DefaultTextFontSize',fontsize)
set(gcf, 'Units', 'inches', 'PaperPosition', [0,0,11,8.5]);
set(gcf, 'Position', [2 1.5 11 8.5 ]);
set(gcf, 'PaperOrientation','landscape');
% setup axes position
position = [xshift yshift width height1];
axes('units','inches','position',position);
% then I plot using contourf
% now save
fileName = '/path/to/file.pdf';
saveas(gcf,fileName,'pdf');

답변 (1개)

Shashank Prasanna
Shashank Prasanna 2013년 7월 9일
Try using export_fig, this is a very popular file central submission that makes exporting figures easy and trouble free:
  댓글 수: 10
Shashank Prasanna
Shashank Prasanna 2013년 7월 11일
Unfortunately, we won't be able to help much without something to work with.
Kellen
Kellen 2013년 7월 11일
Shashank, Thanks again for all of your help. It was a simple fix that a friend caught. I create a new axes for a colorbar, and needed to set 'Visible' to 'Off'. Problem Solved. Thanks again!

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

카테고리

Help CenterFile Exchange에서 Printing and Saving에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by