0
$\begingroup$

I ma trying to plot the following simple contour plot

Clear["Global`*"];
V = x^2*y^2*Exp[-(x^2 + y^2)];
f = 1/2*px^2 + V;
E0 = 0.12;
C0 = ContourPlot3D[f, {x, -3, 3}, {y, -3, 3}, {px, -3, 3}, 
     Contours -> {E0}, PlotPoints -> 50, Mesh -> False, ImageSize -> 550]

However every time the program consumes very quickly all the available memory thus failing in producing the desired graph.

Any ideas why? Is there a way to overcome this issue?

$\endgroup$
  • $\begingroup$ What if you set MaxRecursion -> 0 and increase the PlotPoints setting? $\endgroup$ – J. M. will be back soon Oct 4 '16 at 18:14
  • $\begingroup$ Why 50 plot points?: i.stack.imgur.com/kf4ST.png $\endgroup$ – Michael E2 Oct 4 '16 at 18:19
  • $\begingroup$ @J.M. Now it works fine! But why for this case we should set MaxRecursion -> 0? $\endgroup$ – Vaggelis_Z Oct 4 '16 at 18:19
  • $\begingroup$ Just drop PlotPoints, I get a very decent picture without it, the same when set to 20 or 25 but much faster; MaxRecursion isn't required here. $\endgroup$ – corey979 Oct 4 '16 at 18:20

Your Answer

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

Browse other questions tagged or ask your own question.