Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to plot a two functions together that looks like this:

enter image description here

But I am only able to come up with this;"which is clearly wrong"

Plot3D[{x^2 + x + y^2, x + y}, {x, -20000, 20000}, {y, -20000, 20000}]

I have looked through the help section but somehow I am not getting how to change it.

Ps: I do not care about the range that its plotted in.

share|improve this question
The vertical plane in your figure is not a depiction of a function, as it is multi-valued. Therefore it can't be plotted by Plot3D, which is meant for functions only. – Sjoerd C. de Vries Nov 9 '13 at 8:12
up vote 3 down vote accepted

Just a variant plotting all within ContourPlot and using MeshFunctions to highlight variable kept constant.

ContourPlot3D[{x^2 + x + y^2 - z == 0, x == 0}, {x, -2, 2}, {y, -2, 
  2}, {z, 0, 6}, MeshFunctions -> {#1 &}, Mesh -> {{0.}}, 
 MeshStyle -> {Green, Thick}]

enter image description here

share|improve this answer

One way, I am sure there is a better way, but for now....

eq1 = x^2 + x + y^2;
eqX = x == 0;(*for the yz plan surface*)
lim = 20;
zlim = 800;(*adjust as needed when changing p1*)
p1 = Plot3D[eq1, {x, -lim, lim}, {y, -lim, lim}];
p2 = ContourPlot3D[Evaluate@eqX, {x, -lim, lim}, {y, -lim, lim}, {z, 0, zlim}, 
   ImageSize -> 250];
Show[{p1, p2}, AxesLabel -> {"x", "y", "z"}]

Mathematica graphics

To add more surfaces, just add its equation, for example:

eqY = y == 0; (*for the xz plan  surface *)
p2 = ContourPlot3D[
  Evaluate[{eqX, eqY}], {x, -lim, lim}, {y, -lim, lim}, {z, 0, zlim},
  ImageSize -> 250];

Mathematica graphics

see ContourPlot3D.html and Plot3D.html

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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