【发布时间】:2017-08-31 17:57:34
【问题描述】:
我按照this question 中的步骤进行操作,并尝试将单个文本对象设置为更大的字体。这是我的示例代码:
hf = figure;
set(hf, 'DefaultAxesFontSize', 14)
hx = axes('Parent',hf);
[hx,hp1,hp2] = plotyy(hx, rand(10,1),rand(10,1),rand(10,1),rand(10,1),'scatter');
hlx = xlabel(hx(1), 'Only half of this line show up');
hl1 = ylabel(hx(1), 'Not usually truncated but less border');
hl2 = ylabel(hx(2), 'Only part of this line show up');
ht = title(hx(1), 'Too close to border');
如图所示,标签被图形的边框截断。我必须将图形拖到非常大 - 与预期相反 - 以显示所有文本。
如何根据文本字体大小自动设置文本框,这样即使是小图也不会被剪切?
我知道我可以通过设置轴的Position 来手动完成,但它是一种手动和猜测和尝试的方式。有没有自动计算利润的方法?
【问题讨论】:
标签: matlab matlab-figure