Changing the plotting order in Show

Is it possible to move the first plot in show to the front without changing which plot we inherit the options from?

The problem is that if I want a certain plot to go in front I cannot use it to inherit the options from.

While writing I thought of the following solution. I can include the plot twice. Once as the first argument and again later. Is this the best solution?

• Does it work for you Show[otherPlots.., Graphics[##], ##2]& @@ thePlot ? – Kuba Dec 3 '19 at 13:01
• I'd try Show[plot1, plot2,..., Options[plot2]], but in both my and @Kuba's suggestions, if there is an option in the first plot that is not explicitly overridden by the options, then the option from the first plot will be used. – Michael E2 Dec 3 '19 at 13:45
• If the result of Show looks the way you want it to, I would say your solution of giving one of the plots as both first and last argument is a good solution even if it it not the best solution. I take an engineering view of things; if a solution works without any unwelcome side effects, use it and don't worry about what is best. – m_goldberg Dec 3 '19 at 13:46
• You can also do Show[plot1, plot2, plot2[[2]]]. If you want to suppress the options from first plot entirely you can do Show[Graphics@First@plot1, plot2, plot2[[2]]]. – kglr Jan 7 '20 at 19:29

This is an interesting and common question so, to summarize the suggestions in comments:

• @Kuba suggested:

Show[otherPlots.., Graphics[##], ##2]& @@ thePlot

• @Michael pointed out the following alternative:

Show[plot1, plot2,..., Options[plot2]]


but also mentioned that, if there is an option in the first plot that is not explicitly overridden by the options, then the option from the first plot will still be used.

• As OP themselves mentioned in their question, a pragmatic approach suggested by @m_goldberg would be to simply have one of the plots both first and last in Show. Although perhaps inefficient, it will work and will not suffer from the stray option problem mentioned above.