I like to build sophisticated plots by combining simpler ones with Show[]
. Typically this involves setting non-default Plot-Options with the different Plot-Commands, like
Show[ ListPlot[ ,Op1], Plot[ ,Op2], Op3]
Unfortunately the Show[]
command is not commutative, as
Show[ Plot[ ,Op2], ListPlot[ ,Op1], Op3]
can produce different results. My expectation was that putting settings in Op3
should overwrite the ones in Op1
and Op2
however this does not work with options like PlotMarkers
which are only available within ListPlot[]
.
The description of the Show[g_1, g_2, g_3, ... ,g_i]
-command gives only two hints:
Options explicitly specified in Show override those included in the graphics expression.
and
The lists of non-default options in the
g_i
are concatenated.
I’m not sure what this precisely means. Is
Show[ ListPlot[ ,Op1], Plot[ ,Op2], Op3]
equivalent to
Show[ ListPlot[ ,Union[Op1,Op2]], Plot[ ,Union[Op1,Op2]], Op3]
?
while Op3
overwrites whatever is in Union[Op1,Op2]
?
And there is one more question: In
Show[ g_1, g_2, g_3, ..., g_i ]
the Plot in g_1
seems to be treated specially as it defines the PlotRange
for the final image generated.
I would like to know the full set of rules how the Plot-Options are combined and to which Plot or Plots they are applied.
Show[]
is what delineates thePlotRange
to be followed by the other graphics, in the absence of an explicitPlotRange
setting forShow[]
. CompareShow[Plot[Sin[x], {x, -1, 1}], Plot[Exp[x], {x, -2, 2}]]
andShow[Plot[Sin[x], {x, -1, 1}], Plot[Exp[x], {x, -2, 2}], PlotRange -> {{-3, 3}, All}]
. $\endgroup$Plot[Sin[x], {x, -2, 2}, MaxRecursion -> 1, PlotPoints -> 5, PlotPoints -> 20]
andPlot[Sin[x], {x, -2, 2}, MaxRecursion -> 1, PlotPoints -> 20, PlotPoints -> 5]
. $\endgroup$