Re: Ploting a transformation of a set
- To: mathgroup at smc.vnet.net
- Subject: [mg123409] Re: Ploting a transformation of a set
- From: Barrie Stokes <Barrie.Stokes at newcastle.edu.au>
- Date: Tue, 6 Dec 2011 03:12:33 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <4EDCB5F0.813B.006A.0@newcastle.edu.au>
Hi Ray
Very nice.
This is exactly what I had in mind when I went to use colour in ListPlot, but as I said , ListPlot seems to need Joined->True, and then colours the lines.
Based entirely on your code, I offer the following Manipulate, suggesting other ways to explore/understand the (slightly generalised) transformation.
xy = .08 Flatten[Table[{x, y}, {x, 0, 25}, {y, 0, 25 - x}], 1];
Manipulate[
mapping = (s \[Function] {(s[[1]] + c s[[2]])^p, (s[[2]] + c s[[1]])^
p});
With[{plotstuff = {AspectRatio -> Automatic, Frame -> True},
h = Hue[.5 Plus @@ #] &},
Show[GraphicsRow[
{Graphics[{PointSize[.02], {h@#, Point@#} & /@ xy}, plotstuff],
Graphics[{PointSize[.02], {h@#, Point@mapping@#} & /@ xy},
plotstuff]}],
ImageSize -> 600]],
{{c, 0.5}, 0, 1, 0.05},
{{p, 0.5}, 0.1, 1, 0.05}]
Cheers
Barrie
>>> On 05/12/2011 at 7:49 pm, in message
<485951015.465117.1323074989841.JavaMail.root at jaguar8.sfu.ca>, Ray Koopman
<koopman at sfu.ca> wrote:
> Here are two static plots that should help clarify
> which points on the left map into which points on the right.
> The only difference between the two plots is the definition of h.
>
> xy = .08 Flatten[Table[{x,y}, {x,0,25},{y,0,25-x}], 1];
> UV = Sqrt[#.{{1,.5},{.5,1}}]&;
>
> With[{plotstuff = {AspectRatio -> Automatic, Frame->True},
> h = Hue[.5Plus@@#]&},
> Show[GraphicsRow[
> {Graphics[{PointSize[.03],{h@#,Point@#}&/@xy}, plotstuff],
> Graphics[{PointSize[.03],{h@#,Point@UV@#}&/@xy}, plotstuff]}],
> ImageSize -> 600]]
>
> With[{plotstuff = {AspectRatio -> Automatic, Frame->True},
> h = Hue[(Subtract@@#+2)/4]&},
> Show[GraphicsRow[
> {Graphics[{PointSize[.03],{h@#,Point@#}&/@xy}, plotstuff],
> Graphics[{PointSize[.03],{h@#,Point@UV@#}&/@xy}, plotstuff]}],
> ImageSize -> 600]]
>
> ----- Barrie Stokes <Barrie.Stokes at newcastle.edu.au> wrote:
>> Hi Ray, Hi Justin
>>
>> Ray, I like your idea for displaying this transformation, but wanted
>> to be sure myself which xy points were going to which uv points.
>>
>> The first thing I tried was to get colour into the picture,
>> but the following is deceptive:
>>
>> xy = .2 Flatten[
>> Table[ {x, y}, {x, 0, 10, 0.2}, {y, 0, 10 - x, 0.2} ], 1 ];
>> uv = Sqrt[ xy.{{1, .5}, {.5, 1}} ];
>> With[ {plotstuff = {Joined -> True, AspectRatio -> Automatic,
>> Frame -> True, Axes -> None, Prolog -> PointSize[ .02 ]}},
>> Show[ GraphicsRow[ {ListPlot[ xy, plotstuff,
>> ColorFunction -> "Rainbow" ],
>> ListPlot[ uv, plotstuff, ColorFunction -> "Rainbow" ]} ],
>> ImageSize -> 600 ] ]
>>
>> as I found when I tried
>>
>> Manipulate[
>> (xy = .2 Flatten[
>> Table[ {x, y}, {x, 0, 10, 0.25}, {y, 0, 10 - x, 0.25} ], 1 ];
>> uv = Sqrt[ xy.{{1, .5}, {.5, 1}} ];
>> With[ {
>> plotstuff1 = {AspectRatio -> Automatic, Frame -> True,
>> Axes -> None,
>>
>> Prolog -> {PointSize[ .02 ], {PointSize[ .04 ], Hue[ 0 ],
>> Point[ u ]}}},
>> plotstuff2 = {AspectRatio -> Automatic, Frame -> True,
>> Axes -> None,
>> Prolog -> {PointSize[ .02 ], {PointSize[ .04 ], Hue[ 0 ],
>> Point[ {Sqrt[
>> \!\(\*SubscriptBox[\(u\), \(\(\[LeftDoubleBracket]\)\(\ \)\(1\)\(\ \)\
>> \(\[RightDoubleBracket]\)\)]\) + 0.5
>> \!\(\*SubscriptBox[\(u\), \(\(\[LeftDoubleBracket]\)\(\ \)\(2\)\(\ \)\
>> \(\[RightDoubleBracket]\)\)]\)], Sqrt[
>> \!\(\*SubscriptBox[\(u\), \(\(\[LeftDoubleBracket]\)\(\ \)\(2\)\(\ \)\
>> \(\[RightDoubleBracket]\)\)]\) + 0.5
>> \!\(\*SubscriptBox[\(u\), \(\(\[LeftDoubleBracket]\)\(\ \)\(1\)\(\ \)\
>> \(\[RightDoubleBracket]\)\)]\)]} ]}}}},
>> Show[ GraphicsRow[ {ListPlot[ xy, plotstuff1 ],
>> ListPlot[ uv, plotstuff2 ]} ],
>> ImageSize -> 600 ] ]),
>> {u, {0, 0}, {2, 2}}, ControlType -> Slider2D ]
>>
>> As the latter shows clearly, the xy diagonal maps to the curved end
>> of the "fan" region in the uv plane, but the colours (only possible
>> easily with Joined->True, at a quick look) in the first plot cover
>> the spectrum from red (0,2) to purple (2,0) along the xy diagonal,
>> whereas the colours across the end of the "fan" are in the red to
>> orange range only.
>>
>> I'll bet there are other ways to show the details of such mappings, but
>> I like to try to find uses for Manipulate, hence my red dot animation.
>>
>> Cheers
>>
>> Barrie
>>
>> On 02/12/2011 at 11:20 pm, in message <201112021220.HAA01862 at smc.vnet.net>,
>> Ray Koopman <koopman at sfu.ca> wrote:
>>> On Nov 30, 12:19 am, Justin <justin.vala... at gmail.com> wrote:
>>>> Hello,
>>>> I would like to plot the following transformation of the set
>>>> {x,y; x+y<2 & x>0 & y>0} => {(x+.5y)^.5, (y+.5x)^.5}.
>>>> Is there any way to do this in mathematica?
>>>> thanks
>>>
>>> xy = .2 Flatten[Table[{x,y},{x,0,10},{y,0,10-x}],1];
>>> uv = Sqrt[xy.{{1,.5},{.5,1}}];
>>> With[{plotstuff = {AspectRatio->Automatic, Frame->True, Axes->None,
>>> Prolog->PointSize[.02], DisplayFunction->Identity}},
>>> Show[GraphicsArray[{ListPlot[xy,plotstuff],ListPlot[uv,plotstuff]}],
>>> ImageSize->600]]