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?


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}]]

How can I convert an Overlay into a figure?

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

  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}]}]

How can I convert an Overlay into a figure?

I just combined two Overlay objects using Show

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

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 0.333 (s). 12 q(s)