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.

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

share|improve this question
1  
related: mathematica.stackexchange.com/q/14696/5 –  rm -rf Mar 6 '13 at 1:02

1 Answer 1

up vote 11 down vote accepted
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

share|improve this answer
    
Nice! You beat me by a second. –  s0rce Mar 6 '13 at 0:11
    
+1 beat me by 40 seconds :-) –  Mr.Wizard Mar 6 '13 at 0:11
    
@belisarius sweet thanks! –  Amatya Mar 6 '13 at 0:17

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.