Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 – R. M. Mar 6 '13 at 1:02
up vote 14 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.