I am trying to have multiple subplots. Yet, when I save as PDF, the numbers on x and y axis seem to be very close to each other and I want to avoid that

댓글 수: 6

Ameer Hamza
Ameer Hamza 2020년 4월 22일
Can you give a simple code to create subfigure you are creating and exporting it to the pdf file?
Wasim Ramadan
Wasim Ramadan 2020년 4월 22일
#For example, I am using this to generate one of the subplots
subplot(12,2,1); p = plot(timez,accz,'r'); xlabel('Time (s)'); ylabel(' Acceleration (g) '); axis tight;
.
.
.
#and this to save it in PDF format:
pj = figure(1)
print(pj,'PDFname','-dpdf','bestfit')
Ameer Hamza
Ameer Hamza 2020년 4월 22일
It seems that you are already making very narrow plots. If it appears small on the figure window, then the print will also be small.
Wasim Ramadan
Wasim Ramadan 2020년 4월 22일
Indeed I am producing 24 plots for 1 page.
So it tight, but there is big white margins that I wish to use, or atleast resize the numbers and texts on each axis
Tommy
Tommy 2020년 4월 22일
You could play around with the FontSize property of each set of axes and the Rotation of each YLabel:
for i = 1:24
ax = subplot(12,2,i);
p = plot(rand(10,1),'r');
xlabel(ax, 'Time (s)');
ylabel(ax, ' Acceleration (g) ');
axis(ax, 'tight');
set(ax, 'FontSize', 12);
set(get(ax, 'YLabel'), 'Rotation', 70);
end
Wasim Ramadan
Wasim Ramadan 2020년 4월 22일
Perfect solution Tommy, thats what I was looking for.
thank you.

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

 채택된 답변

Ameer Hamza
Ameer Hamza 2020년 4월 22일

0 개 추천

You can try to change the font size of the labels
ax = subplot(12,2,1);
plot(1:10);
ax.FontSize = 16;

댓글 수: 2

Wasim Ramadan
Wasim Ramadan 2020년 4월 22일
Thank you for your answer Ameer.
Ameer Hamza
Ameer Hamza 2020년 4월 23일
Glad to be of help.

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

추가 답변 (0개)

카테고리

질문:

2020년 4월 22일

댓글:

2020년 4월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by