Re: Combine images, Show[] and its effect on AspectRatio. Plot, Epilog, Circle, Arc
- To: mathgroup at smc.vnet.net
- Subject: [mg105442] Re: Combine images, Show[] and its effect on AspectRatio. Plot, Epilog, Circle, Arc
- From: "Nasser M. Abbasi" <nma at 12000.org>
- Date: Wed, 2 Dec 2009 06:29:21 -0500 (EST)
- References: <hf2mqp$id6$1@smc.vnet.net> <4B14FCDE.90001@metrohm.com>
"dh" <dh at metrohm.com> wrote in message news:4B14FCDE.90001 at metrohm.com... >> > Hi Nasser, > the circle is drawn in the coordinate system of the plot. Therefore, you > need to draw the circle as an ellipss in the "Plot" coordinate system. > This can be done by a scaling transformation that takes care of the aspect > ratio: > > cir = Circle[{0, 0}, 1, {-45 Degree, 180 Degree}]; > pl = Plot[Sin[x], {x, -Pi, Pi}]; > asp = AspectRatio /. FullOptions[pl]; > tr = ScalingTransform[{1/asp, 1}]; > cir = Graphics@GeometricTransformation[cir, tr]; > Show[pl, cir] > Hi Daniel; Notice what I changed the plot range, the circle no longer comes out circular looking. Below I made the plot to go from -5Pi to +5Pi cir=Circle[{0,0},1,{-45 Degree,180 Degree}]; pl=Plot[Sin[x],{x,-5Pi,5 Pi}]; asp=AspectRatio/.FullOptions[pl]; tr=ScalingTransform[{1/asp,1}]; cir=Graphics@GeometricTransformation[cir,tr]; Show[pl,cir] It happens to work ok when the plot range was {-Pi,Pi} (same for the post I just send, which worked for only -Pi,Pi, so I still need to work on this more!), but not for other plots ranges. thanks --Nasser