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

MathGroup Archive 2011

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

Search the Archive

Re: Color grid with x and y args to visualize effects of 2D

  • To: mathgroup at smc.vnet.net
  • Subject: [mg116583] Re: Color grid with x and y args to visualize effects of 2D
  • From: "Christopher O. Young" <cy56 at comcast.net>
  • Date: Mon, 21 Feb 2011 04:19:03 -0500 (EST)
  • References: <ijqqbj$ap3$1@smc.vnet.net>

Thanks, I didn't realize that Mathematica allowed 2 parameters with ParameterPlot in 2D. This is by far the fastest method I've tried so far. Now to figure out
how to use MeshShading to get exactly the hue, saturations, and values.

There's a picture of the sheared grid at

http://home.comcast.net/~cy56/ShearedGrid.png.

Fortunately, column vectors work when multiplied by a matrix (although not
alone), so we have a familiar linear algebra expression for the algebra.

ParametricPlot[{{1, 0.25}, {0, 1}} . {{u},{v}},

  {v, 0, 1}, {u, 0, 1},
  Mesh -> {10, 10},
 MeshShading -> Table[Hue[h,s,1],
   {h,Range[1, 0.1, -(0.9/10)]},
   {s,Range[0.1, 1, 0.9/10]}
   ]

]

On 2/20/11 5:28 AM, in article ijqqbj$ap3$1 at smc.vnet.net, "Heike Gramberg"
<heike.gramberg at gmail.com> wrote:

> I'm not entirely sure how you want to use your function, but if you're
> interested in drawing the image of a rectangular grid after a 2D
> transformation you could do something like this:
> 
> mesh[fx_, fy_, opts___] :=
>  ParametricPlot[{fx[x, y], fy[x, y]}, {x, 0, 1}, {y, 0, 1},
>   Mesh -> 9,
>   MeshShading ->
>    Table[Hue[xi, (1 - yi), 1], {yi, Range[0, 1, 1/10]}, {xi,
>      Range[0, 1, 1/10]}], opts]
> 
> This would draw the image of the square 0<x,y<1 with a 10x10 coloured grid
> under the mapping {x,y}->{fx[x,y],fy[x,y]}.
> 
> Heike.



  • Prev by Date: Re: How to do quickest
  • Next by Date: Re: Cloud Mathematica
  • Previous by thread: Re: Color grid with x and y args to visualize effects of 2D
  • Next by thread: Re: Color grid with x and y args to visualize effects of 2D