Suppose I have plotted two functions $f(x)$ and $g(x)$ on the same plot. I would like to shade the area between the two curves only when $f(x) \geq g(x)$, but I cannot get the Filling command to do the job. Here is my code:
f[n_, d_] := (Sin[Pi/n] + (Sin[Pi/n]^2 + 4*n^2*d^2)^(1/2))/(2*n);R[n_, d_] := 1 - (d^2 + Cos[Pi/n]^2)^(1/2);Plot[{f[4, d], R[4, d]}, {d, 0, 0.2}, AxesLabel -> {d}, PlotLegends -> "Expressions", Filling -> {1 -> {2}, R[4, d] > f[4, d]}]
The graph produces the shaded region everywhere between $f(4,d)$ and $R(4,d)$, but I only want the region between the two curves when $R(4,d) \geq f(4,d)$, or in other words, up untill $d \simeq 0.16$.
Any help would be appreciated!
Filling -> {1 -> {{2}, {Red, None}}}– Mr.Wizard Jul 27 '16 at 01:16