5
$\begingroup$

When using the following manipulate I can rotate the plot and manipulate the value without my view point changing;

Manipulate[Plot3D[Sin[a*x + y^2], {x, -3, 3}, {y, -2, 2}], {a, 1, 5}]

If I rotate one of these plot in the following manipulate the value the view point changes back to the default.

Manipulate[GraphicsRow
[{Plot3D[Sin[a*x + y^2], {x, -3, 3}, {y, -2, 2}],
Plot3D[Sin[a*x + y^2], {x, -3, 3}, {y, -2, 2}]}], 
{a, 1, 5}]

I have a much more complex plot that contains a GraphgicsRow and a Column and I want it to keep the view point of the plot while I manipulate it. Is there a simple way to do this? Is the problem the GraphicsRow or is that just a coincidence?

Thanks.

$\endgroup$
7
$\begingroup$

GraphicsRow is convenient to use, for example, when you would like to control the total width of many graphics or image objects with a single setting - because GraphicsRow takes ImageSize option. But there is no real reason to use it. Use Row instead and control size of graphics individually for each plot:

Manipulate[Row[{
   Plot3D[Sin[a*x + y^2], {x, -3, 3}, {y, -2, 2}, ImageSize -> 300],
   Plot3D[Sin[a*x + y^2], {x, -3, 3}, {y, -2, 2}, ImageSize -> 300]}], {a, 1, 5}]

If you must use GraphicsRow or just curious how to make it work, here is a way - separate with Dynamicthe options of internal Plot3Ds so they do not reset each other. This maybe way to complicated and an overkill - but at least it is interesting:

Manipulate[GraphicsRow[{
   Graphics3D[Dynamic@Plot3D[Sin[a x + y^2], {x, -3, 3}, {y, -2, 2}, 
       Boxed -> False, Axes -> False][[1]]],
   Graphics3D[Dynamic@Plot3D[Sin[a x + y^2], {x, -3, 3}, {y, -2, 2}, 
       Boxed -> False, Axes -> False][[1]]]}], {a, 1, 5}]

You need Graphics3D because it can take Dynamic inside, but Plot3D cannot.

$\endgroup$
  • $\begingroup$ Thanks Vitaliy. It works when I replace the GraphicsRow with a Row. $\endgroup$ – Cam Feb 22 '13 at 2:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.