# Plot 3 variable graph?

**URL:** <https://community.wolfram.com/t/plot-3-variable-graph/11334>\
**Category:** Questions\
**Tags:** algebra, graphics-and-visualization\
**Created:** [September 27, 2017, 9:52am UTC](https://community.wolfram.com/t/plot-3-variable-graph/11334 "2017-09-27T09:52:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sasuke0323](https://avatars.discourse-cdn.com/v4/letter/s/eb8c5e/32.png) [@sasuke0323](https://community.wolfram.com/u/sasuke0323)\
**Post date:** [September 27, 2017, 9:52am UTC](https://community.wolfram.com/t/plot-3-variable-graph/11334/1 "2017-09-27T09:52:04Z")

</div>

I have the function: `x*(1+y)*(z-1)+(1-x)*(1+y),{x, 0, 1}, {y, 0, 2}, {z, 1, 2.5}`

By plotting

```
ContourPlot[x(z-1)+(1-x),{x, 0, 1}, {z, 1, 2.5}]

```

Seems z limits gain of x when z\<2

I tried to overlay the graphs to find when do the gain of y covers z by

```
p1=Plot3D[x(1+y)+(1-x)(1+y), {x, 0, 1}, {y, 0, 2}]
p2=Plot3D[x(z-1)+(1-x),{x, 0, 1}, {z, 1, 2.5}]
Show[p1,p2,PlotRange->All]

```

However they didn’t show intersections, is there any way plotting the original function?  
Or other way to find y value for max output at certain z range?

Thank you!

---

<div class="post-metadata">

**Author:** ![djmpark](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/djmpark/32/4435_2.png) [@djmpark](https://community.wolfram.com/u/djmpark)\
**Post date:** [September 27, 2017, 4:37pm UTC](https://community.wolfram.com/t/plot-3-variable-graph/11334/2 "2017-09-27T16:37:25Z")

</div>

I don’t understand your question. What do you mean by gain? The only fault I find with the ContourPlot is that the 1.0 contour is a little ragged at the left hand end. Try

```
ContourPlot[x (z - 1) + (1 - x), {x, 0, 1}, {z, 1, 2.5},
 MaxRecursion -> 4]

```

You might also try increasing the PlotPoints.

Even though ContourPlot is a 2-dimensional plot it can take a 3-dimensional PlotRange. Sometimes some areas of the plot will be White because the function value is outside the third plot range. So you could use:

```
ContourPlot[x (z - 1) + (1 - x), {x, 0, 1}, {z, 1, 2.5},
 MaxRecursion -> 4,
 PlotRange -> {{0, 1}, {1, 2.5}, {0, 1.6}}]

```

---

<div class="post-metadata">

**Author:** ![anon\_91240867](https://avatars.discourse-cdn.com/v4/letter/a/8baadc/32.png) [@anon\_91240867](https://community.wolfram.com/u/anon_91240867)\
**Post date:** [September 28, 2017, 9:09pm UTC](https://community.wolfram.com/t/plot-3-variable-graph/11334/3 "2017-09-28T21:09:16Z")

</div>

maybe you can use Solve for the intersection of the two equations (where equal) and Plot3D the result? no, overlayed plot3d won’t “automatically highlight intersections”, not that i’ve heard of. i’m unsure if contour plot is right for your application (to show boundaries of intersections by nature of plotting style) - sorry i have no time for doing so. but drawing lines to highlight/color intersections is certainly possible.
