2
$\begingroup$

I am trying to plot a simple graph using Plot3D:

Plot3D[0.25*(1/(1 - 0.9* (1 - bn))) ((1 - bn)/(1 - 0.5* bn))^2, {bn, 0, 1}, {bu, 0, 1}, 
  RegionFunction -> Function[{bn, bu}, bn > bu]]

Which gives the output:

enter image description here

Why is there a triangle where Plot3D keeps the function flat while it is clearly increasing. Here is the graph without limit on the region:

enter image description here

I also tried different approaches. For instance:

Plot3D[0.25*(1/(1 - 0.9* (1 - bn))) ((1 - bn)/(1 - 0.5* bn))^2*If[bn > bu, 1, 0], 
  {bn, 0,1}, {bu, 0, 1}]

with even worst outcome:

enter image description here

Many thanks for your help.

$\endgroup$
1
  • $\begingroup$ ClippingStyle -> None will remove the "triangle" and the answer below overcomes the problem. $\endgroup$ Oct 22, 2013 at 23:38

1 Answer 1

3
$\begingroup$

When Mathematica automatically determines the plot range, it sometimes decides to clip off the very high or very low parts of the graph. It does this, I suppose, when including the extreme parts of the range results in a plot that is flattened too much. If you don't want this, Mathematica also supplies easy options to override the automatic behavior.

Try PlotRange -> All:

Plot3D[0.25*(1/(1 - 0.9*(1 - bn))) ((1 - bn)/(1 - 0.5*bn))^2,
 {bn, 0, 1}, {bu, 0, 1}, RegionFunction -> Function[{bn, bu}, bn > bu], 
 PlotRange -> All]

Mathematica graphics

Only a small part of the graph above sticks up high. With the setting PlotRange -> Automatic, Mathematica decides to chop part of it off. Without the restriction by RegionFunction, as in the OP's second plot, the high part runs along the whole bu axis. In that case, Mathematica doesn't cut it off. If it were steeper it would cut it off:

Plot3D[0.25*(1/(1 - 0.95*(1 - bn))) ((1 - bn)/(1 - 0.5*bn))^2,
 {bn, 0,1}, {bu, 0, 1}]

Mathematica graphics

$\endgroup$
2
  • $\begingroup$ Thank you! Any idea what the problem is with the other methods? $\endgroup$ Oct 23, 2013 at 1:59
  • $\begingroup$ @mathtd See edit. I think that's what you were asking about. I don't know what the exact algorithm is for clipping. $\endgroup$
    – Michael E2
    Oct 23, 2013 at 4:13

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.