Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I want to draw a normalized tangent arrow, so I use the Normalize command as follows:

tangent = 
  Table[{{t, Sin[t]}, {t, Sin[t]} + Normalize @ {1, Cos[t]}}, {t, -π, π, π/2}];
Plot[Sin[x], {x, -2 π, 2 π}, 
  PlotRange -> 2, Epilog -> {Red, Arrowheads[0.02], Arrow /@ tangent}]

and I get this plot:

enter image description here

Seems good, but if take a close look at the length of the arrows, you'll see that the length is not normalized at all. I've tried the Show and Graphics command instead of Epilog, but got the same plot.

Can someone tell me what I missed here?

share|improve this question

closed as off-topic by m_goldberg, Jens, ubpdqn, Yves Klett, RunnyKine Aug 4 at 4:50

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – m_goldberg, Jens, ubpdqn, Yves Klett, RunnyKine
If this question can be reworded to fit the rules in the help center, please edit the question.

3  
Your plot is distorted by the default aspect ratio of 1/GoldenRatio. Add AspectRatio -> Automatic to your plot options –  m_goldberg Aug 4 at 3:56

1 Answer 1

up vote 5 down vote accepted

This issue here is aspect ratio: Using the following slight adaptation of your code:

tangent = 
  Table[{{t, Sin[t]}, {t, Sin[t]} + 
     Normalize@{1, Cos[t]}}, {t, -\[Pi], \[Pi], \[Pi]/2}];
Plot[Sin[x], {x, -2 \[Pi], 2 \[Pi]}, PlotRange -> 2, 
 Epilog -> {{Red, Arrowheads[0.02], Arrow /@ tangent}, 
   Circle[{#, Sin[#]}] & /@ Range[-\[Pi], \[Pi], \[Pi]/2]}]

enter image description here

However, specifying aspect ratio:

tangent = 
  Table[{{t, Sin[t]}, {t, Sin[t]} + 
     Normalize@{1, Cos[t]}}, {t, -\[Pi], \[Pi], \[Pi]/2}];
Plot[Sin[x], {x, -2 \[Pi], 2 \[Pi]}, PlotRange -> 2, 
 Epilog -> {{Red, Arrowheads[0.02], Arrow /@ tangent}, 
   Circle[{#, Sin[#]}] & /@ Range[-\[Pi], \[Pi], \[Pi]/2]}, 
 AspectRatio -> Automatic]

resolves matters: enter image description here

share|improve this answer
    
Thanks a lot. I have another small question. Since many of the default values of options in Mathematica is Automatic, Why WRI choose the default value of the AspectRatio as 1/GoldenRatio? I mean, why not choose Automatic, then in the algorithms(or in the front-end or something like that), Automatic use 1/GoldenRatio as default value? This seems more coherent to me. –  luyuwuli Aug 4 at 4:30
    
@luyuwuli I am afraid I cannot answer that...as humans we make so many arbitrary decisions and adopt arbitrary conventions, August having 31 days, Julian v Gregorian calendar, tau v pi as well as the countless debates in everyday life...I am sure there were reasons, like appeal of golden ratio to human aesthetics etc –  ubpdqn Aug 4 at 4:52
    
Hahaha... Yes, I agree. I ask this because I've suffered a lot in the AspectRatio issue. –  luyuwuli Aug 4 at 5:02

Not the answer you're looking for? Browse other questions tagged or ask your own question.