Re: A bug in Show[]?
- To: mathgroup at smc.vnet.net
- Subject: [mg88574] Re: A bug in Show[]?
- From: "David Park" <djmpark at comcast.net>
- Date: Fri, 9 May 2008 03:22:03 -0400 (EDT)
- References: <fvudq0$ed1$1@smc.vnet.net>
PlotRange is a slightly confusing option in that it confounds two purposes: 1) How Plot and other statements select the final set of points to retain. 2) What the actual displayed domain and range will be. This is even more apparant when doing ContourPlots. There it may be necessary to supply the z range in the ContourPlot (where it has a meaning) but this would not be used in the 2D display. You can see these two different uses in the following statement: model[i_] := Log[i] - Log[i - 1]; Show[Plot[(model[ii]), {ii, 2, 51}, PlotRange -> Full], ListPlot[Table[{im, model[im]}, {im, 2, 51}]], PlotRange -> {-.5, 1.1}] So it is not so much a bug as a confusion of these two different purposes. -- David Park djmpark at comcast.net http://home.comcast.net/~djmpark/ "Alexey Popkov" <popkov at gmail.com> wrote in message news:fvudq0$ed1$1 at smc.vnet.net... > Hello, > Consider the following combined plot: > > model[i_] := Log[i] - Log[i - 1]; > Show[Plot[(model[ii]), {ii, 2, 51}], > ListPlot[Table[{im, model[im]}, {im, 2, 51}]], PlotRange -> All] > > You may see that a part of first Plot is absent. It is easily to > demonstrate that only a part of Plot that is not shown without the > option "PlotRange -> All" is absent: > > Show[Plot[(model[ii]), {ii, 2, 51}], > ListPlot[Table[{im, model[im]}, {im, 2, 51}]]] > > The workaround is to put this option inside first Plot[] instead > outside of those: > > Show[Plot[(model[ii]), {ii, 2, 51}, PlotRange -> All], > ListPlot[Table[{im, model[im]}, {im, 2, 51}]]] > > But in documentation for Show[] one can read: "Options explicitly > specified in Show override those included in the graphics > expression.". Thus this is a bug in Show[]! > > Moreover placing this option inside the second command ListPlot[] has > no result at all (the option is ignored): > > Show[Plot[(model[ii]), {ii, 2, 51}], > ListPlot[Table[{im, model[im]}, {im, 2, 51}], PlotRange -> All]] > > But according to the documentation "The lists of non-default options > in the Subscript[g, i] are concatenated.". Thus it seems to be the > second bug in Show[]! >