I have s set 3d data points which I want to rotate, so that the size of the box does not change. Also if possible the window size which contains the plot should not change ist size.
How can I achieve that?
Here is my code:
SeedRandom[1];
data = RandomReal[10, {500, 3}];
Manipulate[
Graphics3D[
{PointSize[Medium], Point[data, VertexColors -> (Hue /@ Rescale[data[[All, 1]]])]},
SphericalRegion -> True, Axes -> True,
AxesEdge -> {{-1, -1}, {-1, -1}, {-1, -1}},
ViewProjection -> "Orthographic", Boxed -> True,
AxesLabel -> {"x axis", "y axis", "z axis"},
ViewPoint ->
N @ Dynamic[15*{Sin[α] Cos[β], Sin[α] Sin[β], Cos[α]}], ImageSize -> Small],
{{α, N @ π/3}, N @ π/360, π, π/360, Appearance -> "Labeled"},
{{β, N@π/4}, 0., 2 π, 2 π/360, Appearance -> "Labeled"}]
Result:
ImageSize -> {600, 400}
instead ofSmall
. $\endgroup$ImagePadding
, likeImagePadding -> {{10, 10}, {10, 10}}
. $\endgroup$SphericalRegion -> True
helps to avoid the view point depending shifting of the box. $\endgroup$SphericalRegion
was also my first reaction, but then realized that it was already included among the options. $\endgroup$