# Plot 3 variable graph?

Posted 1 year ago
1559 Views
|
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<2I 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!
2 Replies
Sort By:
Posted 1 year ago
 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}}]