Suppose you have a program that produces plots. Later a user wishes to combine some of them with Show. The options in the first plot will override the options in the second plot (see Plot Option Precedence while combining Plots with Show[]). This is particularly unfortunate with options whose settings can be concatenated, such as Prolog and Epilog.
Is there some convenient way to combine such plots and at the same time combine the settings for options that can be meaningfully concatenated, such as Prolog and Epilog?
Example. Given the two plots:
plot1 = Plot[Sin[x], {x, -Pi, Pi},
Prolog -> {Red, Disk[{Pi/2, 0}]},
Epilog -> {Purple, Thickness[0.05], Line[{{-Pi, 1/2}, {Pi, 1/2}}]}
]
plot2 = Plot[Cos[x], {x, -Pi, Pi},
Prolog -> {Yellow, Disk[]},
Epilog -> {Green, Thickness[0.05], Line[{{-Pi, -1/2}, {Pi, -1/2}}]}
]
The combined output should look like this:





PlotRangewould take a lot more code than that. – Michael E2 Jan 14 '17 at 22:44PlotRange -> (All &)was a mistake. It's not the same as taking the smallest bounding box of the two plot ranges. So I edited it out of my first comment. – Michael E2 Jan 14 '17 at 22:48(#& @* fn)is a neat trick! – Simon Woods Jan 14 '17 at 23:22