I would like to shade a horizontal region in LogLogPlot as in the figure below. The figure on the left is done with LogLogPlot:
LogLogPlot[x^2, {x, 10^-10, 10^5}, Frame -> True, GridLines -> Automatic, GridLinesStyle -> Directive[Dashed, LightGray], PlotLegends -> Placed[LineLegend[{Automatic}, {"y=\!\(\*SuperscriptBox[\(x\), \ \(2\)]\)"}], {.88, .15}]]
I am able to achieve the desired effect (figure on the right) by combining the plot with a RegionPlot:
f1 = Plot[Log[10, (10^xvar)^2], {xvar, -10, 5}, Axes -> False];
f2 = RegionPlot[-4 < xvar < 1, {xvar, -10, 5}, {yvar, -21, 11}, BoundaryStyle -> None, PlotStyle -> Directive[Antialiasing -> True, Hue[1, .6, 1, .3]], PlotLegends -> Placed[LineLegend[{Automatic}, {"y=\!\(\*SuperscriptBox[\(x\), \ \(2\)]\)"}], {.88, .12}]];
xticks = Table[{x, Superscript[10, ToString[x]]}, {x, -10, 5, 3}];
yticks = Table[{x, Superscript[10, ToString[x]]}, {x, -21, 11, 10}];
Show[{f1, f2}, Frame -> True, GridLines -> Automatic, GridLinesStyle -> Directive[Dashed, LightGray], Epilog -> {Text[Style["Awesome region", Hue[1, .5, .8]], Scaled[{0.54, 0.8}]]}, FrameTicks -> {{yticks, None}, {xticks, None}}]
However, this seems like a very inefficient way of doing such a simple thing as I have to map the logarithmic scales (because RegionPlot doesn't support log scales) and then map the ticks to get the right labels. Surely there must be a way of doing this in LogLogPlot directly.
LogLogPlot
s but the second should show the function likePiecewise@{{10^-22,x<10^-4},{10^10,10^-4<x<7*10^-2}}
withFilling->Axis
$\endgroup$