I want to place a Text
(or some other Graphics object) outside the PlotRange
using the Epilog
option. I know that I can do this by adding some ImagePadding
and using PlotRangeClipping -> False
(see eg. this post).
However, PlotRangeClipping->False
is not an option for me, because in the final Graphics
object I need to combine several plots using Show
with a new PlotRange
. The individual plots extend this range, and therefore the plots will leak out of the desired plot region.
Is there a way to place the Text outside the PlotRange without using PlotRangeClipping -> False
?
As a minimal example to see the unwanted behavior I create two plots:
p1 = ListLinePlot[{{-1, 1}, {10, 3}}, PlotRange -> All];
p2 = ListLinePlot[{{1, 1}, {10, 10}}, PlotRange -> All];
and use Show to display both with the additional Text:
Show[{p1, p2},
PlotRange -> {{0, 5}, {0, 8}},
Frame -> True,
PlotRangeClipping -> False,
ImagePadding -> {{All, 50}, {All, All}},
Epilog -> Style[Text["A", Scaled[{1.1, 0.5}]], Red, Large]
]