MathGroup Archive 2009

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

Search the Archive

Re: Where does the 'z' come from?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg105415] Re: Where does the 'z' come from?
  • From: Szabolcs Horvát <szhorvat at gmail.com>
  • Date: Tue, 1 Dec 2009 06:27:58 -0500 (EST)
  • References: <hf2msf$iel$1@smc.vnet.net>

On 2009.12.01. 10:15, Lawrence Teo wrote:
> Mathematica v7.0 has this sample for ContourPlot[]
>
> ListContourPlot[
>   Table[Sin[x] Sin[y], {x, -3, 3, 0.1}, {y, -3, 3, 0.1}],
>   ContourLabels ->
>    Function[{x, y, z}, Text[Framed[z], {x, y}, Background ->  White]]]
>
> Where does the z come from?
> Can I say that the x and y come from the iteration by Table[]?
> Is z an implicit variable?
>

The symbols x,y,z in the Function[...] have absolutely nothing to do 
with the x and y in Table[...].  x,y,z are local to Function and x,y are 
local to Table.  The following is completely equivalent to the example 
from the docs:

 > ListContourPlot[
 >   Table[Sin[i] Sin[j], {i, -3, 3, 0.1}, {j, -3, 3, 0.1}],
 >   ContourLabels ->
 >    Function[{a, b, c}, Text[Framed[c], {a, b}, Background ->  White]]]


  • Prev by Date: Re: Re: Re: Bug ??????
  • Next by Date: Re: Plotting a table of piecewise functions
  • Previous by thread: Where does the 'z' come from?
  • Next by thread: Re: Where does the 'z' come from?