Message Boards Message Boards


Plot 3 variable graph?

Posted 2 years ago
2 Replies
0 Total Likes

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}]

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!

2 Replies

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}}] 

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.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract