13
$\begingroup$

I want to fill the area between two curves only when curve-1 (Black) is below curve-2(Blue). So In this example, I don't want the middle portion shaded but just the left and right tails to be shaded. It is not possible for me to always solve for the points of intersection since it might involve using FindRoot and stuff and may not be worth the trouble. Can someone please tell me how to do that. Thanks.

Plot[{0.8333*H + 16.928*H^0.25 - 85, 
  Max[-9 + Max[H - 80, 0], H - 80]}, {H, 0, 700}, 
 PlotStyle -> {Directive[Black, Thick], Black}, Filling -> {1 -> {2}}]

enter image description here

$\endgroup$
18
$\begingroup$
Plot[{0.8333*H + 16.928*H^0.25 - 85,  Max[-9 + Max[H - 80, 0], H - 80]}, {H, 0, 700}, 
     PlotStyle -> {Directive[Black, Thick], Black}, 
     Filling -> {1 -> {{2}, {Yellow, Transparent}}}]

Mathematica graphics

$\endgroup$
  • $\begingroup$ Nice! You beat me by a second. $\endgroup$ – s0rce Mar 6 '13 at 0:11
  • $\begingroup$ @belisarius sweet thanks! $\endgroup$ – Amatya Mar 6 '13 at 0:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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