`注释`超出允许的数字范围

问题描述 投票:0回答:1

annotation 不同,

text
 不允许负位置,但我需要前者来定位 absolute。但在下面的示例中,我需要负位置(文本应该更低)。

有解决办法吗?我想可以填充图形,但我不知道该怎么做,而且它需要适用于所有人

view
(文本必须保持绝对定位)。

[X, Y, Z] = ndgrid(linspace(-8,8,40), linspace(-8,8,40), linspace(-8,8,40));
D = X.*Y.*Z;
D = D * (100 / max(D, [], 'all'));

for ii = 10:10:100
    patch(isosurface(D, ii, D), 'FaceColor', 'interp', 'LineStyle', 'none')
end
view([3 1 1])
annotation('textbox', [.5 0 .1 .1], 'String', 't=5', 'EdgeColor', 'none')
matlab matlab-figure
1个回答
0
投票

注释被添加到

AnnotationPane
类中,所以

an = annotation('textbox', [.5 0 .1 .1], 'String', 't=5', 'EdgeColor', 'none');

给我们注释,并且

p = an.Parent;

为我们提供注释窗格。

您可以编辑作为注释窗格子项的文本对象的特定文本位置,尽管我不能 100% 确定文本框位置与注释位置的关系:

p.Children(1).Position(2) = 0;

© www.soinside.com 2019 - 2024. All rights reserved.