0
$\begingroup$

I want to draw the following plot----

Let, $x=\{0,0.1,\cdots,1\}$ and $y=\{0,0.1,\cdots,1\}$;

Now, I have two different scenarios:

Scenario-1: $N=\{x\}$ or $N=\{y\}$

then if $N=\{x\}$, then $z=x$ or if $N=\{y\}$, then $z=y$;

Scenario-2: $N=\{x,y\}$

then $z=1-(1-x)(1-y)$

The plot should contain both the scenarios.

for the second case, I do this

Plot3D[1 - (1 - x) (1 - y), {x, 0, 1}, {y, 0, 1}]

Then how to combine Scenario 1 with it?

$\endgroup$

3 Answers 3

0
$\begingroup$

I understand that you have tree surfaces, being planes two of them, so:

ContourPlot3D[{z - y == 0, z - y == 0, (1 - x) (1 - y) + z == 1}, {x, 
0, 1}, {y, 0, 1}, {z, 0, 1}, ContourStyle -> Opacity[0.6], 
Mesh -> None, AxesLabel -> (Style[#, 16, Bold] & /@ {"x", "y", "z"}),
SphericalRegion -> True]

enter image description here

  • Additional thoughts:

I am considering the first scenario again. If you are meaning that $z=x$ when $N=\{x,0\}$ and $z=y$ when $N=\{0,y\}$, then:

ContourPlot3D[{x == 0, y == 0, (1 - x) (1 - y) + z == 1}, {x, 
0, 1}, {y, 0, 1}, {z, 0, 1}, ContourStyle -> Opacity[0.6], 
Mesh -> None, AxesLabel -> (Style[#, 16, Bold] & /@ {"x", "y", "z"}),
SphericalRegion -> True]

enter image description here

$\endgroup$
3
$\begingroup$

Have you tried Show?

Plot1=Plot3D[1 - (1 - x) (1 - y), {x, 0, 1}, {y, 0, 1}]
Plot2=Plot3D[x, {x, 0, 1}, {y, 0, 1}]
Show[Plot1,Plot2]

Also using Plotstyle, changing Opacity or color can help for better representation.

$\endgroup$
0
$\begingroup$

use the following:

Plot3D[{x, 1 - (1 - x) (1 - y)}, {x, 0, 1}, {y, 0, 1}]

you can plot them separately as follows:

Plot3D[1 - (1 - x) (1 - y), {x, 0, 1}, {y, 0, 1}]

Plot3D[x, {x, 0, 1}, {y, 0, 1}]
$\endgroup$
1
  • $\begingroup$ see my edit? but how to combine them in one plot? $\endgroup$ Commented Nov 16, 2017 at 6:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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