3

I'd like to add at least one arrow to a closed contour in the plane to show that e.g. a circumference is counterclockwise oriented. If I use e.g.

ParametricPlot[ReIm[Exp[I t]], {t, 0, 2 \[Pi]}]

how can I insert an option to add arrows along the circumference or other closed contour?

CharlesG
  • 131
  • 4

3 Answers3

5
$Version

(* "12.3.1 for Mac OS X x86 (64-bit) (June 19, 2021)" *)

Clear["Global`*"]

pp = ParametricPlot[ReIm[Exp[I t]], {t, 0, 2 π}];

Show[pp,
 Graphics[Arrow /@ 
   Partition[Cases[pp, Line[pts_] :> pts, Infinity][[1]], 221]],
 Frame -> True]

enter image description here

EDIT: Re question in comments, to reverse the arrows change the Graphics to

Graphics[Arrow /@ 
  Partition[Reverse[Cases[pp, Line[pts_] :> pts, Infinity][[1]]], 
   221]]
Bob Hanlon
  • 157,611
  • 7
  • 77
  • 198
5
ParametricPlot[ReIm[Exp[I t]], {t, 0, 2 \[Pi]}] /. 
 Line[data___] :>  {Arrowheads[{{.1, 0.1}, {.1, 0.5}}], Arrow[data]}  

enter image description here

There are a lot of explanations about the post-processing .../.Line[data__] :> ... Here

In Arrowheads[{{.1, .09}, {.1, 0.5}}] the .1 specify the size of the arrows, .09 and 0.5 their location along the Line. See Arrowheads documentation.

andre314
  • 18,474
  • 1
  • 36
  • 69
3
ParametricPlot[ReIm[Exp[I t]], {t, 0, 2 π}, 
 PlotStyle -> Arrowheads[Table[Large, 4]]] /. Line -> Arrow 

enter image description here

ParametricPlot[ReIm[Exp[I t]], {t, 0, 2 π}, 
  PlotStyle -> Arrowheads[Table[-Large, 4]]] /. Line -> Arrow

enter image description here

kglr
  • 394,356
  • 18
  • 477
  • 896