Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: A bug in Show[]?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg88570] Re: [mg88559] A bug in Show[]?
  • From: Carl Woll <carlw at wolfram.com>
  • Date: Fri, 9 May 2008 03:21:19 -0400 (EDT)
  • References: <200805080815.EAA14372@smc.vnet.net>

Alexey Popkov wrote:

>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[]!
>  
>
The documentation says:

Show can be used with Graphics and Graphics3D.

So, Show can override the options in Graphics and Graphics3D objects. 
Now Plot isn't a Graphics object until it is evaluated, and the options 
to Plot will determine what kind of Graphics object is created. In this 
case, the Graphics object created when using PlotRange->Automatic is 
different from the Graphics object created when using PlotRange->All. 
Basically, more points are included in the Line primitive in the 
Graphics object when Plot is used with the PlotRange->All option. 
Changing the PlotRange option of a graphic created using the 
PlotRange->Automatic option will not cause these additional points to 
magically appear.

Carl Woll
Wolfram Research


  • Prev by Date: RE: Formatting Problem with Summation Symbol
  • Next by Date: Re: Re: Question on the Limiting Value of Ratios of Consecuative Primes...
  • Previous by thread: A bug in Show[]?
  • Next by thread: Re: A bug in Show[]?