# Manipulate - why does the axis scale change when I release the slider?

I was playing around with Manipulate to demonstrate simple geometric idea of conic sections and put this little sample together. When i move the slider it moves my plane, which is what I expect. However, when I let go of the slider, the graphics are rescaled. So how I stop that? I have set the PlotRange and AspectRatio, so I don't understand why the scale is changing.

Manipulate[
plot = Plot3D[n, {x, -1, 1}, {y, -1, 1},
AspectRatio->1, PlotRange->{{-1, 1}, {-1, 1}}, Mesh->False];
cone = Graphics3D[{Opacity[0.3], Cone[{{0, 0, -1}, {0, 0, 1}}, 1]},
PlotRange->{{-1, 1}, {-1, 1}}, AspectRatio->1];
Show[{plot, cone}, AspectRatio->1],
{{n, 0}, -1, 1}]


 Manipulate[
plot = Plot3D[n, {x, -1, 1}, {y, -1, 1}, BoxRatios -> 1,
PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1}}, Mesh -> False];
cone = Graphics3D[{Opacity[0.3], Cone[{{0, 0, -1}, {0, 0, 1}}, 1]},
PlotRange -> {{-1, 1}, {-1, 1}, {-1, 1}}, BoxRatios -> 1];
Show[{plot, cone}, BoxRatios -> 1], {{n, 0}, -1, 1}]


Update: Shorter version (that also avoids the constant dynamic updates in the previous version):

 Manipulate[Show[Plot3D[n, {x, -1, 1}, {y, -1, 1}, BoxRatios -> 1,
PlotRange -> {-1, 1}, Mesh -> False],
Graphics3D@{Opacity[0.3], Cone[{{0, 0, -1}, {0, 0, 1}}, 1]}],
{{n, 0}, -1, 1}]


or

 Manipulate[ Graphics3D[{LightBlue,
Polygon[{{-1, -1, n}, {-1, 1, n}, {1, 1, n}, {1, -1, n}}],
Opacity[0.3], Cone[{{0, 0, -1}, {0, 0, 1}}, 1]},
PlotRange -> {-1, 1}, BoxRatios -> 1],
{{n, 0}, -1, 1}]

• Excellents. Thanks for help. Commented Feb 4, 2013 at 15:43
• @DavidMcHarg, my pleasure. Welcome to Mathematica.SE.
– kglr
Commented Feb 4, 2013 at 15:44
• Never new about Initialization option, thanks for that. Commented Feb 4, 2013 at 17:21
• @Nasser, good point; added simpler/shorter versions that eliminate the need for Show.
– kglr
Commented Feb 4, 2013 at 17:28

I updated my example to allow both the plane to be moved up/down and to change the inclination of the plane. I nice little example for conic sections, good for kids to see this stuff in action.

Manipulate[plot = Plot3D[ n x+m,{x,-1,1},{y,-1,1},
BoxRatios->1,PlotRange->{{-1,1},{-1,1},{-1,1}},Mesh->False];
cone = Graphics3D[{Opacity[0.3],Cone[{{0,0,-1},{0,0,1}},1]},
PlotRange->{{-1,1},{-1,1},{-1,1}},BoxRatios->1];
Show[{plot,cone},BoxRatios->1],
{{n,0,"Angle"},-1,1},{{m,0,"Intersection"},-1,1}
]


• nice :)) ... +1. (You might consider adding TrackedSymbols -> {n, m}to avoid the constant flickering.)
– kglr
Commented Feb 4, 2013 at 17:56
• also for kids to enjoy: ice cream cones :)
– kglr
Commented Feb 4, 2013 at 18:05