0
$\begingroup$

I make two Plot3D with the same `ViewPoint, but clearly the two 3Dplots' axes are not at the same angles... when put next to each other they are clearly not seen from the same point?

Is it possible to fix it?

   um = 1;
    Potential[V0_, k_, w_, x_, z_] := V0*(Sin[k z]^2)*Exp[(-2 x^2)/w^2] 
    Plot3D[Potential[1, (2 \[Pi])/(0.725 um ), \[Infinity], x, 
      z], {x, -2.1 um, 2.1 um}, {z, -1.1 um, 1.1 um}, 
     PlotRange -> {Automatic, Automatic, {0, 1}}, PlotPoints -> 50, 
     Mesh -> None, Boxed -> False, PlotStyle -> LightCyan, 
     Axes -> {True, True, False}, 
     Ticks -> {Table[i, {i, -2, 2, 1}], {}},  
     ViewPoint -> {1.6, -1.7, 1.3}, ImageSize -> Medium]
    Plot3D[Potential[1, (2 \[Pi])/(0.725 um), 1 um, x, z], {x, -2.1 um, 
      2.1 um}, {z, -1.1 um, 1.1 um}, 
     PlotRange -> {Automatic, Automatic, {0, 1}}, PlotPoints -> 50, 
     MeshFunctions -> {# &, #2 &, #3 &}, 
     Mesh -> {Thread[{{0, 0.5, 1}, {Red, Darker@Blue, Darker@Green}}], 0, 
       0}, MeshStyle -> {Automatic, Orange, Purple}, Boxed -> False, 
     Axes -> {True, True, False}, PlotStyle -> LightCyan, 
     Ticks -> {Table[i, {i, -2, 2, 1}], {}},   
     ViewPoint -> {1.6, -1.7, 1.3}, 
     ImageSize -> Medium]
$\endgroup$
  • $\begingroup$ does this give what you need: Graphics3D[{plt1[[1]], GeometricTransformation[plt2[[1]], TranslationTransform[{4, 4 (1.6/1.7), 0}]]}, ViewPoint -> {1.6, -1.7, 1.3}, Boxed -> False]? (where plt1 and plt2 are your two 3D plots) $\endgroup$ – kglr Feb 7 at 22:57
  • $\begingroup$ Yeah but the axes are gone and the aspect ratio are not the same as I chose in my code? $\endgroup$ – SuperCiocia Feb 7 at 23:30

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.