Skip to main content

plotting - Filling a curve to a vertical axis


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 they axis? I find no mention of this kind of filling in the standard documentation.



Answer



Adding a line at the minimum value and shading as normal:-


min = MinValue[ArcCot[x], 0 <= x <= 1, x];
Plot[{ArcCot[x], min}, {x, 0, 1}, PlotRange -> {{0, 1.1}, {0.5, 2}},
AxesLabel -> {x, y}, Filling -> {1 -> {2}}, PlotStyle -> {Automatic, None}]

enter image description here


Comments