# Filling between ParametricPlot and Plot

There are some similar questions: (1) (2) have been ask, but I think this is a different one.

If we have a ParametricPlot and a Plot, how to Filling between them. For example, the ParametricPlot is $(\cos^2(x)+x, x-\sin(x))$, the Plot is $y=x$, and the plot range is $(0,1)$.

• Please try to write down the code for the parametric plot and the plot. Thanks. – Dr. belisarius Oct 26 '14 at 16:10

p1[x_] := {Cos@x^2 + x, x - Sin@x};

Plot[{x, p1[t][] /. FindRoot[p1[t][] == x, {t, 1}]}, {x, 0, 5},
Filling -> {1 -> {2}}] Or perhaps better:

p = {Cos@#^2 + # &, # - Sin@# &};
Plot[{x, p[]@InverseFunction[p[]]@x}, {x, 0, 5}, Filling -> {1 -> {2}}] You can post-process the output of ParametricPlot to change lines into a polygon:

pplt = ParametricPlot[{{x , x}, {Cos[x]^2 + x, x - Sin@x}}, {x, 0, 5}];

coords = Cases[Normal[pplt], {dir___, Line[x_]} :> x, Infinity];
Graphics[{{Red, Thick, Line @ #, Blue, Line @ #2, LightBlue,
Polygon[Join[#, Reverse @ #2]]} & @@ coords},
Frame -> True, AspectRatio -> 1 / GoldenRatio] 