MathGroup Archive 2009

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

Search the Archive

Re: PlotRange

  • To: mathgroup at smc.vnet.net
  • Subject: [mg103369] Re: PlotRange
  • From: Szabolcs Horvát <szhorvat at gmail.com>
  • Date: Fri, 18 Sep 2009 05:37:51 -0400 (EDT)
  • References: <h8t2d1$se6$1@smc.vnet.net>

On 2009.09.17. 12:18, Bill Rowe wrote:
> On 9/16/09 at 5:47 AM, l.balzano at gmail.com (Luigi B) wrote:
>
>> I am generating some 2D images with MatrixPlot and using the option
>> PlotRange->{All,All,All}. I know the range that the plotting routine
>> is using for the x- and y- directions. The values of the points
>> (i.e. the z- scale) is changing every image. After plotting, I would
>> like to know what are the values Mathematica has used. Any help?
>
> Here is an example
>
> data = RandomReal[1, {5, 5}];
> plot = MatrixPlot[data]
>
> In[6]:= PlotRange /. FullOptions[plot]
>
> Out[6]= {{0., 5.}, {0., 5.}}

I would like to draw the attention to the fact that PlotRange (and some 
other options) are used in two different (but related ways) in 
Mathematica.  This can sometimes be confusing.

1.  Every Graphics[] object has an attached coordinate system, and a 
PlotRange property that controls the region that is shown, in this 
coordinate system.  This is what FullOptions returns when used on a 
Graphics object.

2.  Plotting functions such as LogLogPlot or MatrixPlot have a PlotRange 
option which specifies which part of the input data will appear in the 
final plot.

The input data often does not map directly to the Graphics coordinates, 
e.g. in a LogLogPlot, so the PlotRange returned by FullOptions will not 
be the same that was passed to LogLogPlot.  Also, when graphing 
two-variable functions in 2D (MatrixPlot, DensityPlot, ContourPlot, 
etc.), PlotRange accepts three bounds: two for the function domain and 
one for the function value.  The OP was asking about the plot range for 
the function value, which is not preserved in the final Graphics object.


  • Prev by Date: Re: Table and ParallelTable. Strange behaviour.
  • Next by Date: Re: Re: NDSolve Mathematica 6 and 7
  • Previous by thread: Re: PlotRange
  • Next by thread: symbolic differentiation of a scalar field