如何将点标签添加到我的绘图中?
How to add point labels to my plot?
下面我试图在 3 个维度上绘制一个结。我想按 p1、p2、p3...p6 的顺序标记每个点,甚至只是 1、2、3、...6 就足够了。我该怎么做?
`
P1 = {0.300775, 1.301248, -0.702434}
P2 = {-0.976281, -0.910795 , 0.701983}
P3 = {0.976171, -0.910795, -0.702076}
P4 = {-0.300495 , 1.300967, 0.702620}
P5 = {-1.276451, -0.390204, -0.702474}
P6 = {1.276282, -0.390420 , 0.702381}
Knot = {P1, P2, P3, P4, P5, P6, P1}
Show[
Graphics3D[Line[Knot]],
Graphics3D[Point[Knot]],
Axes -> True,
AxesLabel -> {x, y, z}]
`
这是输出的图片:
Show[Graphics3D[Line[Knot]],
Graphics3D[
MapIndexed[Text[Style["P" <> ToString[#2[[1]]], Medium, Red], #,{-1,-1}] &,
Knot[[;;-2]]]], Graphics3D[Point[Knot]], Axes -> True,
AxesLabel -> {x, y, z}]
不幸的是,很难让 3d 文本真正看起来不错。
这是没有样式的地图,以使其更容易理解。
MapIndexed[Text["P" <> ToString[ #2[[1]] ], #] &
下面我试图在 3 个维度上绘制一个结。我想按 p1、p2、p3...p6 的顺序标记每个点,甚至只是 1、2、3、...6 就足够了。我该怎么做?
`
P1 = {0.300775, 1.301248, -0.702434}
P2 = {-0.976281, -0.910795 , 0.701983}
P3 = {0.976171, -0.910795, -0.702076}
P4 = {-0.300495 , 1.300967, 0.702620}
P5 = {-1.276451, -0.390204, -0.702474}
P6 = {1.276282, -0.390420 , 0.702381}
Knot = {P1, P2, P3, P4, P5, P6, P1}
Show[
Graphics3D[Line[Knot]],
Graphics3D[Point[Knot]],
Axes -> True,
AxesLabel -> {x, y, z}]
`
这是输出的图片:
Show[Graphics3D[Line[Knot]],
Graphics3D[
MapIndexed[Text[Style["P" <> ToString[#2[[1]]], Medium, Red], #,{-1,-1}] &,
Knot[[;;-2]]]], Graphics3D[Point[Knot]], Axes -> True,
AxesLabel -> {x, y, z}]
不幸的是,很难让 3d 文本真正看起来不错。
这是没有样式的地图,以使其更容易理解。
MapIndexed[Text["P" <> ToString[ #2[[1]] ], #] &