Mathematica 文档指出:“三维图形中的文本放置在与指定点 {x,y,z} 的投影相对应的位置。文本绘制在所有其他对象的前面”。你如何相对于图像大小定位文本?
这是如何在 2D 中完成的:
custumLabels = Graphics[{
Text[Style["A", Red, Bold, 18], ImageScaled[{0.025, .95}]],
Text[Style["B", Red, Bold, 18], ImageScaled[{0.95, .05}]]}
];
Framed[Show[
Plot[
Sin[x] Exp[x], {x, 0, 10},
Frame -> True,
PlotRangeClipping -> False,
FrameLabel -> {"x", "y"}
],
custumLabels
],
FrameMargins -> 0]
只要
PlotRangeClipping
,这些标签就会一直出现在那个位置。设置为 False
.问题是,如果我切换到 Graphics3D
,你如何让这些标 checkout 现在那个特定的位置? .用一个简单的试试。Framed[Show[
Graphics3D[{Sphere[{0, 0, 0}, 1]}]
],
FrameMargins -> 0]
最佳答案
Epilog
和 Prolog
在 3D 中使用缩放的 2D 坐标系(对于所有基元):
Graphics3D[{Sphere[]}, Epilog -> Text["abcdef", Scaled[{0.1, 0.1}]]]
关于wolfram-mathematica - 数学 : Text in Graphics3D relative to image coordinates,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6337036/