I use this code:
ContourPlot3D[x^2 + y^2 + z^2 == 1, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}]
But I can not to see the coordinate axes inside the sphere like the following picture:
I use this code:
ContourPlot3D[x^2 + y^2 + z^2 == 1, {x, -1, 1}, {y, -1, 1}, {z, -1, 1}]
But I can not to see the coordinate axes inside the sphere like the following picture:
For instance, you can do the following:
Show[Graphics3D[
MapThread[{Black, Arrow@Tube@{{0, 0, 0}, #1},
Text[#2, #1, {0, -1}]} &, {2 IdentityMatrix[3], {x, y, z}}],
Boxed -> False],
ContourPlot3D[
x^2 + y^2 + z^2 == 1, {x, -1, 1}, {y, -1, 1}, {z, -1, 1},
ContourStyle -> Opacity[1/2]]]
Show[
Graphics3D@{Arrow[{{0, 0, 0}, {1, 0, 0}}]},
Graphics3D@{Arrow[{{0, 0, 0}, {0, 1, 0}}]},
Graphics3D@{Arrow[{{0, 0, 0}, {0, 0, 1}}]},
ContourPlot3D[
x^2 + y^2 + z^2 == .05,
{x, -1, 1}, {y, -1, 1}, {z, -1, 1},
ContourStyle -> {Green, Opacity[0.1]},
Mesh -> 1,
MeshStyle -> Red
],
Boxed -> False
]
Graphics3D@{Text[X, {1.1, 0, 0}]},
Graphics3D@{Text[Y, {0, 1.1, 0}]},
Graphics3D@{Text[Z, {0, 0, 1.1}]},
Show[
Graphics3D@{Arrow[{{0, 0, 0}, {1, 0, 0}}]},
Graphics3D@{Arrow[{{0, 0, 0}, {0, 1, 0}}]},
Graphics3D@{Arrow[{{0, 0, 0}, {0, 0, 1}}]},
Graphics3D@{Text[X, {1.1, 0, 0}]},
Graphics3D@{Text[Y, {0, 1.1, 0}]},
Graphics3D@{Text[Z, {0, 0, 1.1}]},
ContourPlot3D[
x^2 + y^2 + z^2 == .05,
{x, -1, 1}, {y, -1, 1}, {z, -1, 1},
ContourStyle -> {Green, Opacity[0.3], Specularity[1]},
Mesh -> 1,
MeshStyle -> Red
],
Boxed -> False
]
Refactored for brevity and with increased PlotPoints
:
m = IdentityMatrix[3];
Show[
Graphics3D[{
Arrow[{{0, 0, 0}, #} & /@ m],
FontSize -> 20,
Thread@Text[{"X", "Y", "Z"}, 1.1 m]
}],
ContourPlot3D[
x^2 + y^2 + z^2 == .05,
{x, -1, 1}, {y, -1, 1}, {z, -1, 1}
, ContourStyle -> {Opacity[0.3, Green], Specularity[1]}
, Mesh -> 1
, MeshStyle -> Red
, PlotPoints -> 40
]
, Boxed -> False
]
PlotPoints
$\endgroup$
Commented
Aug 14, 2016 at 10:48