Exporting a figure containing subplots to pdf in exact dimensions

조회 수: 2 (최근 30일)
Soumyadip
Soumyadip 2014년 5월 26일
댓글: Soumyadip 2014년 5월 26일
Hi, I have been struggling with this issue for quite a long time. I have this code:-
y = -16.55 : 0.01: 16.55;
xpos = 10.5361 * cos(y/10.5361) * (pi/20);
x = [-xpos,xpos];
y = [y,-y];
a1 = subplot(1,4,1);
fill(x,y,'r');
a2 = subplot(1,4,2);
fill(x,y,'g');
a3 = subplot(1,4,3);
fill(x,y,'o');
a4 = subplot(1,4,4);
fill(x,y,'w');
set(a1,'Units','centimeters','Position',[0 0 5 36]);
set(a2,'Units','centimeters','Position',[5.5 0 5 36]);
set(a3,'Units','centimeters','Position',[11 0 5 36]);
set(a4,'Units','centimeters','Position',[16.5 0 5 36]);
I want to export this whole figure to pdf (including the part not visible on screen) in exact dimensions but what is appearing in the pdf is only the part visible on the screen. I checked out this link but this is not working with subplots. Please help.

답변 (1개)

Star Strider
Star Strider 2014년 5월 26일
Experiment with the 'OuterPosition', 'PaperPosition', and other Figure Properties. They seemed a partial solution, but since I don’t know exactly what you want, I will leave you to find the optimal settings for them.
  댓글 수: 1
Soumyadip
Soumyadip 2014년 5월 26일
I just want the entire plot printed in same dimensions, i.e, it should be of length 33.1(2 x 16.55) cm and width as calculated from the equation. Any method would do.

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

카테고리

Help CenterFile Exchange에서 Subplots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by