# Filling between two plots up to some boundaries only [duplicate]

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!

## marked as duplicate by bbgodfrey, Edmund, Mr.Wizard♦ plotting StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Jul 27 '16 at 1:17

• I believe you want e.g. Filling -> {1 -> {{2}, {Red, None}}} – Mr.Wizard Jul 27 '16 at 1:16