6

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. 尝试一个简单的。

Framed[Show[
  Graphics3D[{Sphere[{0, 0, 0}, 1]}]
 ],
 FrameMargins -> 0]
4

1 回答 1

6

EpilogProlog在 3D 中使用缩放的 2D 坐标系(对于所有图元):

Graphics3D[{Sphere[]}, Epilog -> Text["abcdef", Scaled[{0.1, 0.1}]]]

在此处输入图像描述

于 2011-06-13T22:32:50.633 回答