How can I convert an Overlay into a figure?

Now I'm trying to use

Show[plota, Epilog->Inset[inset, Scaled->[{0.2, 0.7}]]]

operation to insert an inset of a figure, where plota is an Overlay of two plots

plota = Overlay[{plotb, plotc}];

and then I cannot be successfully inserted in because "Overlay is not a type of graphics" so it cannot be showed.

What should I do to make the inset works?

Replay

As JasonB temporarily commented you can Rasterize an Overlay to convert it into a (rasterized) Graphics expression.

plotB = Plot[2 Sin[x] + x, {x, 0, 15}, Filling -> Bottom];
plotC = Plot[Sinc[x], {x, 0, 10}, PlotStyle -> Green, Axes -> False];

plotA = Overlay[{plotB, plotC}];

inset = Graphics[{Red, Thick, Dashed, Circle[]}];

Show[Rasterize @ plotA,
Epilog -> Inset[inset, Scaled[{0.3, 0.6}]]
]

Doing this you will however loose the scalability of (un-rasterized) vector graphics. You may instead want to Inset repeatedly:

Show[plotB,
Epilog -> {
Inset[plotC, Automatic, Automatic, Scaled[{1, 1}]],
Inset[inset, Scaled[{0.3, 0.6}]]
}
]

You can just make everything an Inset, this way you don't even need an underlying Graphics object to build on top of. Using the plots from Mr. Wizard's post,

insetA = Overlay[{plotB, plotC}];
insetB = Overlay[{plotA, [email protected][{0, 0}, .1]}];
Show[Graphics /@ {Inset[insetA, {0, 0}, {0, 0}],
Inset[insetB, Scaled[{-.05, -.05}], {0, 0},
Scaled[{.5, .5}], {1, 1}]}]

I just combined two Overlay objects using Show

Category: overlay Time: 2016-07-29 Views: 0
Tags: overlay