2
$\begingroup$

As you can see in the picture below, I have plotted three different functions. Since two functions (red and blue) have the same value for a certain region (equity > 60), I was wondering how I can make it look more intuitiv for the observer that the values are the same. I was thinking of an pattern in red and blue or something similar.

Scratched area of red and blue

$\endgroup$
1
  • 1
    $\begingroup$ Could you provide a code to work with? A minimal example. $\endgroup$
    – Kuba
    Jan 20, 2016 at 18:42

2 Answers 2

3
$\begingroup$

You could do this for example :

gr00 = Plot3D[x^4, {x, 0, 1}, {y, 0, 1}, MeshFunctions -> {#1 + #2 &},
    Mesh -> 30];
gr01 = Plot3D[0, {x, 0, 1}, {y, 0, 1}, MeshFunctions -> {#1 - #2 &}, 
   MeshShading -> {None, Green}];
Show[gr00, gr01]

enter image description here

There is a lattice in the zone where the curves are considered as "equals".
I don't know what's the "equality" criterion (it depends on the ViewPoint, it is implemented in the 3D rendering engine).

One can play with Opacity[] too :

gr00 = Plot3D[x^4, {x, 0, 1}, {y, 0, 1}, MeshFunctions -> {#1 + #2 &},
    Mesh -> 30, MeshShading -> {Directive[Opacity[0.9], Yellow]}];
gr01 = Plot3D[0, {x, 0, 1}, {y, 0, 1}, MeshFunctions -> {#1 - #2 &}, 
   MeshShading -> {None, Green}];
Show[gr00, gr01]

enter image description here

$\endgroup$
3
$\begingroup$

Following @andre... but don't forget to set the ViewPoint to reveal the overlap of the functions in question:

gr00 = Plot3D[x^4, {x, 0, 1}, {y, 0, 1}, 
   MeshFunctions -> {#1 + #2 &},
   Mesh -> 40,
   MeshShading -> {None, {Opacity[0.5], Red}}];
gr01 = Plot3D[0, {x, 0, 1}, {y, 0, 1}, MeshFunctions -> {#1 - #2 &}, 
   MeshShading -> {None, Green}];
Show[gr00, gr01,
 ViewPoint -> {1.1, -1.5, .3}]

enter image description here

$\endgroup$

Your Answer

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

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