2
$\begingroup$

The following script generates two plots in a row, both of them controlled by Manipulate. I would like to combine them together in one.

The problem I don't know how to solve is that the plotting region in Q is different for the two plots, even though it is included in the range $Q \in [0,1]$.

Manipulate[Row[{
    Plot3D[{
            (1 - 2 Q - Sqrt[1 - Δ^2] Cos[2 θ]) (1 + Sqrt[1 - Δ^2] Cos[2 θ])
            }, {θ, 0.001, π/2 - 0.001}, {Q, 0, Min[((1 - Δ^2) Sin[2 θ]^2)/(2 (1 + (-1)^0 Sqrt[1 - Δ^2] Cos[2 θ])), -(-1)^0 Sqrt[1 - Δ^2] Cos[2 θ]]},
            AxesLabel -> Automatic, PlotRange -> {Automatic, Automatic, {0, 1}}, ImageSize -> Large
    ],
    Plot3D[{
            (1 - Sqrt[1 - Δ^2] Cos[2 θ]) (1 - 2 Q + Sqrt[1 - Δ^2] Cos[2 θ])
            }, {θ, 0.001, π/2 - 0.001}, {Q, 0, Min[((1 - Δ^2) Sin[2 θ]^2)/(2 (1 + (-1)^1 Sqrt[1 - Δ^2] Cos[2 θ])), -(-1)^1 Sqrt[1 - Δ^2] Cos[2 θ]]},
            AxesLabel -> Automatic, PlotRange -> {Automatic, Automatic, {0, 1}}, ImageSize -> Large
    ] 
}], {{Δ, 0}, -1, 1}]

PS The range in $\theta$ is $[0.001, \pi/2 -0.001] $ to prevent errors.

$\endgroup$
  • 1
    $\begingroup$ What is wrong with using Show to combine them and then use PlotRange->All? screen shot !Mathematica graphics $\endgroup$ – Nasser Mar 5 '15 at 7:16
  • $\begingroup$ Good job Nasser, post the answer. Thanks @Kuba for editing $\endgroup$ – Nicola Mar 5 '15 at 7:23
3
$\begingroup$

To combine the 2 plots, you can use Show. In addition, since Show takes its options from the first plot, you can override these by using PlotRange->All in the Show itself, at the end. Like this

Manipulate[
 Show[      
    Plot3D[...],
    Plot3D[...],
    PlotRange -> All
  ]
 , ....]

Mathematica graphics

$\endgroup$

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.