12
$\begingroup$

H$\vphantom{a}$i. Consider the following code:

f1 = Plot3D[-Exp[-x^2-y^2],{x,-5,5},{y,-5,5},PlotRange->All]
f2 = Graphics3D[Table[{Arrowheads[.01],Arrow[{{2Cos[i],2Sin[i],0},{2.5Cos[i], 2.5Sin[i],0}}]},{i,0,2Pi,2Pi/40}]]

enter image description hereenter image description here

So far so good. Let us now combine these figures into a single figure:

Show[f1, f2]

enter image description here

For some reason, some arrows look funny: their heads are much larger than they should be. The behaviour is even weirder if we rotate the figure

enter image description here

What's going on here? how can I fix this?

Thanks.

$\endgroup$

1 Answer 1

12
$\begingroup$

The problem can be identified if you just do

Show[f2, BoxRatios -> {1, 1, 2}]

arrowheads

I talked about this issue in this answer, and my suggestion would be to use the same solution here. I'd suggest just using the function arrowLine I defined in that answer.

$\endgroup$
4
  • $\begingroup$ Yep, this works perfectly. Thanks! $\endgroup$ Commented Jun 4, 2017 at 16:55
  • $\begingroup$ @AccidentalFourierTransform I looked at my suggestion of BoxRatios->Automatic in the linked answer and find that it doesn't work properly here. So I'd say just use the arrowLine function. That Arrowheads stuff is just badly designed. $\endgroup$
    – Jens
    Commented Jun 4, 2017 at 16:56
  • $\begingroup$ I'm not sure why you say it doesn't work properly here. I changed Exp[-x^2-y^2] to 3Exp[-x^2-y^2], and the result looks fine to me. $\endgroup$ Commented Jun 4, 2017 at 17:01
  • $\begingroup$ @AccidentalFourierTransform if you look closely the heads are still off, at least in my plots... so I'd really say ditch the built-in arrows. $\endgroup$
    – Jens
    Commented Jun 4, 2017 at 17:24

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