Question: I am preparing a figure for an article, and I would like very much to be able to fill a curve, but not under it, but to the vertical axis, i.e. to the left. Due to the meaning of the data I present, I cannot exchange the axes.

Here is a minimal example:

```
Plot[ArcCot[x], {x, 0, 1}, PlotRange -> {{0, 1.1}, {0.5, 2}}, AxesLabel -> {x, y}]

```

Can anyone think of a way of filling the curve to the`y` axis? I find no mention of this kind of filling in the standard documentation.

Answer: 
This is my second answer, which is a rather different (and simpler) idea than my first one, namely, add a polygon that shades from a `Line` in the plot to a vertical axis at `x = x0`.

```
fillVertical[plot_, x0_: 0.] := plot /. Line[p_] :>
   {{Opacity[0.2], Polygon[p ~Join~ {{N @ x0, p[[-1, 2]]}, {N @ x0, p[[1, 2]]}}]}, 
    Line[p]}

```

The shading automatically takes the color (and other directives) from the plot styles. If the graph of a single function consists of several lines, then several polygons will be drawn and they might overlap. If the endpoints of the graph are not the extrema, then an edge of the polygon will cut through the graph.\*

*Example*

```
fillVertical[
 Plot[{ArcCot[x], 0.4 Sin[10 x] + x/2, 2 - x^2/3}, {x, 0.5, 2}, 
  PlotRange -> {{0, 2.1}, {0., 2}}, AxesLabel -> {x, y}]]

```

![Mathematica graphics](https://i.stack.imgur.com/bKbS4.png)

\*\*Note:\* I thought about using `MaxValue` and `MinValue`, but it seemed unclear to me what the desired shading would be if the extrema do not occur at endpoints. I imagine that shading to a vertical axis would be sought only when the function is invertible (i.e., when $x$ is a function of $y$). So, for example, *not* the case of the sine graph shown above. It turns out `fillVertical` works for invertible `Piecewise` functions. The one below would be difficult with the standard filling options of `Plot`. (Observe that the extrema do occur at endpoints of `Lines` of the graph).

```
fillVertical[
 Plot[Piecewise[{{x, 0 <= x <= 1}, {3 - x, 1 < x}}], {x, 0.5, 2}, 
  PlotRange -> {{0, 2.1}, {0., 2}}, AxesLabel -> {x, y}]]

```

![Mathematica graphics](https://i.stack.imgur.com/K1ml0.png)
Using the function that I've previously defined [here](https://mathematica.stackexchange.com/questions/33126/filling-between-curves/33134#33134), we can do this:

```
Clear[x, y];

p = Plot[ArcCot[x], {x, 0, 1}, PlotRange -> {{0, 1.1}, {0.5, 2}}, AxesLabel -> {x, y}];

shadeBoundedArea[p, ArcCot[1] < y < ArcCot[x]]

```

![filled](https://i.stack.imgur.com/7HCo5.png)