# Inserting element into predefined Show object

I have a predefined function that consists of a number plots combined with Show. Is it possible to add another graphics object at a particular position from the function directly? Simplified example:

figure[x0_] := Show[{
Plot[x - x0, {x, -10, 10}],
Plot[x^2, {x, -10, 10}],
Plot[x^3, {x, -10, 10}]
}];
figure I want to be able to generate something analogous to:

block = Graphics[{LightRed, Rectangle[{-20, -20}, {0, 0}]}];
Show[{
Plot[x - 2, {x, -10, 10}],
Plot[x^2, {x, -10, 10}],
block,
Plot[x^3, {x, -10, 10}]
}] with figure(2] and block directly, something functionally similar to

Insert[output,block,3]


The key point being that the order matters. Is there a convenient way of doing so?

• Insert[figure, block[], {1, 3}]? – kglr Apr 10 '19 at 1:27
• It seems that the most straightforward thing is to combine them using the Show statement as follows: Show[{ figure, block }]. – Alexei Boulbitch Apr 10 '19 at 8:07
• @AlexeiBoulbitch The OP wants to insert block between the 2nd part and the 3rd part of figure and precises that the "order matters", hence my answer. – andre314 Apr 10 '19 at 8:43
• @ andre314 Exactly that I do not understand, since the result is the same. – Alexei Boulbitch Apr 10 '19 at 9:32
• @AlexeiBoulbitch In this case yes. But it is possible that the OP has over-simplified his example. – andre314 Apr 10 '19 at 9:47

Insert[figure, block[], {1, 3}] You can do :

figure[x0_] :=
Show[{Plot[x - x0, {x, -10, 10}], Plot[x^2, {x, -10, 10}],
Plot[x^3, {x, -10, 10}]}];

block = Graphics[{LightRed, Rectangle[{-20, -20}, {0, 0}]}];

Show[
Graphics[figure[[1, 1]]]
, Graphics[figure[[1, 2]]]
, block
, Graphics[figure[[1, 3]]]
, Options[figure]] Options[figure] retrieves the original options of figure that are lost when extracting Graphics[figure[[1, 1]]].

EDIT

Note that Show[{ figure, block }]doesn't give the result expected by the OP :

> Show[{ figure, block }] 