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: