How can I produce a fill (in a plot) that extends between two given abscissa values, and "infinitely" in the ordinate direction? (Of course, here "infinitely" just means "up to the top and bottom boundaries of the plot, whatever those may be".)
I thought that RegionPlot
would do the trick, but no: RegionPlot
requires that the extent of regions be fully specified in both directions; e.g. it does not understand a third parameter having a form anything like {y, -Infinity, Infinity}
.
EDIT: Let me clarify the question.
Just as an example, imagine that I have a random bunch of Graphics
objects displayed together:
OK, now, I want to show a vertical shaded band between x=-1
and x=1
. Conceptually, this is a very simple, commonplace idea, but to do it with Mathematica one must suffer a little...
Note that for the desired modification only two parameters are relevant: the abscissas of the edges of the region of interest. Any $y$-dimension information is completely extraneous to the problem, and can only complicate or sharply reduce the generality of the original figure.
I was not able to find any way to do what I want to do that did not require specifying extraneous, irrelevant parameters. For example:
Why did the aspect ratio change? Who knows.
More importantly, notice that for RegionPlot
I had to specify the irrelevant range parameters {x, -5, 5}
and {y, -1, 6}
. These parameters are, in fact, worse than irrelevant: they actually mess up what was there before. For example, now the content-agnostic All
spec in the pre-existing PlotRange->{{-5, 5}, All}
parameter, and the also content-agnostic PlotRangePadding->0.5
specification, no longer work. I have to replace the first one with a fragile, hard-coded vertical range specification, and fuss with the second one:
My hope is to find a way to achieve the same effect that is less disruptive, and that it does not force me to specify irrelevant or excessively specific parameters.