Re: Turning image in GraphicsArray 90 degrees
- To: mathgroup at smc.vnet.net
- Subject: [mg3516] Re: [mg3487] Turning image in GraphicsArray 90 degrees
- From: jpk at apex.mpe.FTA-Berlin.de (Jens-Peer Kuska)
- Date: Wed, 20 Mar 1996 02:49:25 -0500
- Sender: owner-wri-mathgroup at wolfram.com
> I want to turn some (the uneven) images in a GraphicsArray 90 degrees.
> e.g. page 175 of Wolfram with 2D images.
>
> If I take two images (plots) I want to go from a X value to an Y value in
> the right Plot. Then from the Y-value in the Left-Plot (vertical) I want to
> go a Z-value on a horizontal axis.
>
> I have Windows 8.11, 486 8MB, MMa 2.2 for Students.
>
> Thank you in advance for evt. co-thinking.
> ---------------------------------------------------------------
> Jan Holland txp at pop.pi.net
Hi Jan,
here is the solution
(* at first make two pictures *)
pic1=
Plot[ x^2,{x,0,4},
DisplayFunction->Identity];
pic2=
Plot[Log[1+y],{y,0,16},
DisplayFunction->Identity];
(* Plot produces Line-primitives for 2d lines we must
reverse the {x,y} pairs to get {y,x}
*)
Show[
GraphicsArray[
{pic1,
pic2 /. Line[pnts_] :>
Line[ Reverse /@ pnts]}
]
];
(* this works fine now we need a function that counts the
positions in the list of graphs and applys the
transformation rule to the even
*)
InvertEvenGraphs[
lst:{_Graphics..}]:=
MapIndexed[
If[EvenQ[First[#2]],
#1 /. Line[pnts_] :>
Line[Reverse /@ pnts],
#1] &,
lst
]
(* let's try it out *)
Show[
GraphicsArray[
InvertEvenGraphs[
{pic1,pic2}
]
]
];
(* this woks also fine You may add a
Partiton[InvertEvenGraphs[..],2] to
get more than two pictures
*)
Hope that helps
Jens
==== [MESSAGE SEPARATOR] ====