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: 
A somewhat roundabout way (switch x,y; fill; switch x,y again):

```
With[{plot = Plot[ArcCot[x], {x, 0, 1}, PlotRange -> {{0, 1.1}, {0.5, 2}}, 
    AxesLabel -> {x, y}]},
 With[{pts = Cases[plot,
                   Line[p_] :> (p /. {x_Real, y_Real} :> {y, x}), 
                   Infinity]},
  Show[
   ListLinePlot[pts, Filling -> Axis] /. {x_Real, y_Real} :> {y, x}, 
   FilterRules[Options[plot], Options[Graphics]]]
  ]]

```

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

One advantage to this roundabout way is filling to the axis `x = 0` when the `Plot` domain does not include it. Here we change the plot domain to `{x, 0.5, 2}`:

```
With[{plot = Plot[ArcCot[x], {x, 0.5, 2},
                  PlotRange -> {{0, 2.1}, {0., 2}}, AxesLabel -> {x, y}]},
 With[{pts = Cases[plot,
                   Line[p_] :> (p /. {x_Real, y_Real} :> {y, x}),
                   Infinity]},
  Show[
   ListLinePlot[pts, Filling -> Axis, AxesOrigin -> {0, 0},
     FilterRules[Options[plot], Cases[Options[ListLinePlot], Except[PlotRange -> _]]],
     Options[plot, PlotRange] /. {rx_List, ry_List} :> {rx, ry}] /.
       {x_Real, y_Real} :> {y, x},
   Options[plot, PlotRange]]
  ]]

```

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

If placing the `y` axis to the right is desired, then the `AxesOrigin` can be used with `ListLinePlot` (when the coordinates are switched). Something like this:

```
Clear[x, y];
With[{plot = Plot[ArcCot[x], {x, 0.5, 2},
    PlotRange -> {{0.4, 2.1}, {0., 2}}, AxesLabel -> {x, y}]},
 With[{pts = Cases[plot,
                   Line[p_] :> (p /. {x_Real, y_Real} :> {y, x}),
                   Infinity]},
  Show[ListLinePlot[pts, Filling -> Axis, Frame -> True, AxesOrigin -> {0, 2.1},
     FilterRules[Options[plot], Cases[Options[ListLinePlot], Except[PlotRange -> _]]],
     Options[plot, 
       PlotRange] /. {rx_List, ry_List} :> {rx, ry}] /. {x_Real, y_Real} :> {y, x},
   Options[plot, PlotRange]]
  ]]

```

![Mathematica graphics](https://i.stack.imgur.com/mpmaq.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)