Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

How can I add lines that demarcate the different regions of the following 3D plot:

Plot3D[1/(1 + E^(-a - c)), {a, -8, 8}, {c, -8, 8}]

To give you an idea of what I have in mind I have added the lines and descriptions in the 3D plot in paint; now I want to know how to do it directly in Mathematica.

enter image description here

share|improve this question
2  
Crossposted here –  Vitaliy Kaurov Dec 25 '13 at 23:58
add comment

1 Answer

up vote 12 down vote accepted

MeshFunctions are generally quite useful for making such demarcations:

With[{d = {Thick, Yellow}},
    Plot3D[1/(1 + E^(-a - c)), {a, -8, 8}, {c, -8, 8}, PlotPoints -> 50, 
        MeshStyle -> {Black, Black, d, d, d}, Mesh -> {10, 10, {0}, {0}, {0}}, 
        MeshFunctions -> {# &, #2 &, # &, If[# <= 0, # + #2] &, If[# <= 0, #2] &}
    ]
]

share|improve this answer
1  
I was working on MeshFunctions too, but couldn't get the function definitions quite right. Didn't know that the If's without second argument could work here. –  Sjoerd C. de Vries Dec 26 '13 at 0:06
    
@SjoerdC.deVries I'm not sure that they do. Try permuting the order of the mesh functions. When one If returns a Null, mesh functions later in the list are messed up. –  Michael E2 Dec 26 '13 at 4:13
    
Thanks for the reply! Sorry for crossposting (I did not anticipate that you would be so quick and effective in replying!) –  Guest Dec 26 '13 at 8:14
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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