在Matlab中绘制具有许多子图的大图形 [英] Plot a big figure with many subfigures in matlab
问题描述
我必须打印一张大海报,其中包含一个数字矩阵,让MATLAB安排它们对我来说非常实用.不幸的是,子图显示为适合特定的图形尺寸,因此很小且变形.我不想调整图形尺寸,而是要调整海报的纸张尺寸.
I have to print a large poster, containing a matrix of figures, and it would be very practical for me to let MATLAB arrange them. Unluckily, subplots are displayed to fit a certain figure size, so are tiny and distorted. Instead of fitting the figure size, I would like to fit the paper size of my poster.
我尝试过使用set(gcf,'Position'..)
,并且还更改了纸张尺寸,但是仍然看不到预期的结果.
I have tried with set(gcf,'Position'..)
, and also changing papersize, but I still don't see the expected result.
是否可以尝试让MATLAB使用整个A0图纸进行绘制?
Is there something I can try to let MATLAB use, say, a whole A0 sheet to plot?
这是我当前的输出:
推荐答案
%just a dummy example
r=11;
c=4;
f=figure()
for inx=1:r*c
subplot(r,c,inx)
bar(randi(10,4,3))
end
%print it on A0
set(f,'paperunits','centimeter')
set(f,'papersize',[84.1,118.9])
set(f,'paperposition',[0 0 84.1 118.9]);
print(f,'example.pdf','-dpdf','-opengl');
如果我在A0上打印这样的图,一切看起来都很好.您的屏幕可能太小,但可以放在A0纸上.
If I print such a Plot on A0 everything looks fine. Your screen might be too small, but it fits on a A0 sheet.
这篇关于在Matlab中绘制具有许多子图的大图形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!