31

6

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.**

1Indeed, the first graphic in

`Show[]`

is what delineates the`PlotRange`

to be followed by the other graphics, in the absence of an explicit`PlotRange`

setting for`Show[]`

. Compare`Show[Plot[Sin[x], {x, -1, 1}], Plot[Exp[x], {x, -2, 2}]]`

and`Show[Plot[Sin[x], {x, -1, 1}], Plot[Exp[x], {x, -2, 2}], PlotRange -> {{-3, 3}, All}]`

. – J. M.'s ennui – 2012-01-18T09:09:11.613If possible, could you maybe post the specific example that is troubling you? – J. M.'s ennui – 2012-01-18T09:10:17.587

1Additionally, options are parsed left to right. Compare

`Plot[Sin[x], {x, -2, 2}, MaxRecursion -> 1, PlotPoints -> 5, PlotPoints -> 20]`

and`Plot[Sin[x], {x, -2, 2}, MaxRecursion -> 1, PlotPoints -> 20, PlotPoints -> 5]`

. – J. M.'s ennui – 2012-01-18T09:13:06.927This is described in the "possible issues" section of the Show documentation.

– Simon – 2012-01-18T09:29:54.093@J.M. This question is on my long-standing list of open Mathematica questions. It is not connected to any specific plot. I have never been able to completely unravel the rules the govern the application of the PlotOptions. – uli – 2012-01-18T09:32:20.873

@Simon What is written in the "possible issues" section of the Show documentation, is at best misleading. The non-default options are of course the interesting ones. But the example given there is about the default PlotRange. – uli – 2012-01-18T09:35:59.403