5
$\begingroup$

I'm trying to add arrows to a trajectory in ParametrcPlot3D

    ParametricPlot3D[{Cos[t], Cos[t] Sin[t], t}, {t, 0, 10}, 
  BoxRatios -> {1, 1, 1}, PlotRange -> All] /. 
 Line[x_] :> {Arrowheads[{0, 0.04, 0.04, 0.04, 0.04, 0}], Arrow[x]}

The arrow that I obtain change with the 3d view. the closer ones look larger and the further ones look small. how can I have the size of the arrow fixed for all 3d views?

Update: It is important that the size of the arrow can be controlled, i.e, the symbolic presentation of Tiny toLarge are not sufficient.

enter image description here

$\endgroup$
5
+25
$\begingroup$

You could use a custom glyph, like this:

Manipulate[
 h = Graphics[Triangle[{{0, -0.3}, {a, 0}, {0, 0.3}}]];
 ParametricPlot3D[{Cos[t], Cos[t] Sin[t], t}, {t, 0, 10}, 
   BoxRatios -> {1, 1, 1}, PlotRange -> All] /. 
  Line[x_] :> {Arrowheads[{0, {size, Automatic, h}, {size, Automatic, 
       h}, {size, Automatic, h}, {size, Automatic, h}, 0}, 
     Appearance -> "Projected"], Arrow[x]}, {{size, 6}, 4, 
  20}, {{a, 1}, 0.1, 3}]

enter image description here

$\endgroup$
  • $\begingroup$ As far as I can tell, you are doing essentially the same thing that I suggested, that is, using sizes that are much larger than 1. $\endgroup$ – Carl Woll Aug 27 '18 at 21:37
  • $\begingroup$ I just added an option to increase the length of the arrow (triangles) $\endgroup$ – M.R. Aug 27 '18 at 22:49
  • $\begingroup$ @M.R, when the image is rotated, the size of the arrows change. $\endgroup$ – jarhead Aug 31 '18 at 12:07
3
$\begingroup$

You can use one of the symbolic sizes to create arrowheads that have a fixed size:

ParametricPlot3D[
    {Cos[t],Cos[t] Sin[t],t},
    {t,0,10},
    BoxRatios->{1,1,1},
    PlotRange->All
] /. Line[x_] :> {Arrowheads[{0,Large,Large,Large,Large,0}], Arrow[x]}

enter image description here

Addendum

I don't know of any documented method to generated fixed arrow head sizes other than using the symbolic values Tiny, Small, etc. However, it seems that using a size greater than 10 or so will generate an arrow head with a fixed size, presumably in pixels. So:

ParametricPlot3D[
    {Cos[t],Cos[t] Sin[t],t},
    {t, 0, 10},
    BoxRatios->{1, 1, 1},
    PlotRange->All
] /. Line[x_] :> {Arrowheads[{0,40,40,40,40,0}],Arrow[x]}

enter image description here

$\endgroup$
  • $\begingroup$ Can you make them fixed in a size that is much larger then the symbolic size Large? $\endgroup$ – jarhead Aug 24 '18 at 13:47
  • $\begingroup$ @jarhead See update $\endgroup$ – Carl Woll Aug 24 '18 at 18:56
  • $\begingroup$ thanks for the update and the effort, but this way around does not solve the problem yet. In other plots your suggestions, Arrow size Large/40, appear extremely too small/large. $\endgroup$ – jarhead Aug 26 '18 at 7:06
  • $\begingroup$ I've updated the question $\endgroup$ – jarhead Aug 26 '18 at 8:16
  • $\begingroup$ @jarhead An example plot where my suggestions don't help would be useful. $\endgroup$ – Carl Woll Aug 26 '18 at 15:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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