Re: Combine images, Show[] and its effect on
- To: mathgroup at smc.vnet.net
- Subject: [mg105441] Re: Combine images, Show[] and its effect on
- From: "Nasser M. Abbasi" <nma at 12000.org>
- Date: Wed, 2 Dec 2009 06:29:08 -0500 (EST)
- References: <hf3086$mpm$1@smc.vnet.net>
Thanks every one for the answers, they helped me understand more about this problem. What I wanted to actually do is to have an arrow at the end of the Arc. Once I had the Arc looks more circular now (with your help), I found that there is no easy way I could add an arrow at the end of the Arc. So, I ended up making a list of points that traces the shape of the ellipse, and then used ListPlot and added an Arrow by using the last 2 points of this list of points. Here is the code: p = Plot[Sin[x], {x, -Pi, Pi}]; asp = AspectRatio /. FullOptions[p]; a = 1; b = asp; (* major and minor axis of ellipse *) (*this below is polar equation for ellipse using origin as center of ellipse*) r[theta_] := Module[{}, a*(b/Sqrt[(b*Cos[theta])^2 + (a*Sin[theta])^2])] (* now make points x,y tracing the above ellipse *) data = Table[{r[theta]*Cos[theta], r[theta]*Sin[theta]},{theta, -30*Degree, 130*Degree, 1*Degree}]; (* now display all, add an arrow at the end of the arc *) Show[ p, ListPlot[data, Joined -> True], Graphics[ Arrow[{data[[-2]], data[[-1]]}] ] ] But I think what David Park said in his reply is correct, and I quote him " The problem with the replies I saw this morning is that the arc is still not circular. That is because (I think) AspectRatio does not refer to the Frame of the plot but to the overall plot box that also contains the tick labels. This makes it more difficult and you have to guess at the proper circle scaling. " The arc is not really circular in shape, but it is more circular than without the ellipse transformation trick. So I ended up, in my other code, having to, by trial and error, find a different value for the "b" variable shown above than the one found from the AspectRatio of the underlining plot to get the arc to look more circular. --Nasser
- Follow-Ups:
- Re: Re: Combine images, Show[] and its effect on
- From: Murray Eisenberg <murray@math.umass.edu>
- Re: Re: Combine images, Show[] and its effect on