TikZ-PGF – Direction Arrows on a Circle

arrowscirclestikz-pgf

I would like to plot circle (or another curve) with positive direction (and show it wit arrows).

This plots the circle

\documentclass{article}
\usepackage{tikz}
\RequirePackage{pgfplots}
\usetikzlibrary{shadows}
\usetikzlibrary{shapes}
\usetikzlibrary{decorations}
\usepackage{verbatim}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\setlength\PreviewBorder{5pt}
\begin{document}
\begin{tikzpicture}
    \begin{axis}[
            xmin=-1.5,xmax=2.5,ymin=-1.5,ymax=1.5,
            axis lines=center,
            ticks=none,
            unit vector ratio*=1 1 1,
           ]        
          \addplot [very thick, smooth, domain=(0:2*pi)] ({1.+cos(deg(x))},{sin(deg(x))});

      \addplot[only marks,mark=*] coordinates{(1,0)};
        \end{axis}
\end{tikzpicture}
\end{document}

And I want to add arrows like that

example image

Would you advise me how to add such arrows?

Best Answer

This is your code with the addition of arrows and decorations.markings tikzlibraries plus a tikz style (redarrows.tikstyle) where the arrow heads are defined. The code lets you easily customize the color and the shape af the arrowheads. I used >, but if you like another style refer to the list contained in Is it possible to change the size of an arrowhead in TikZ/PGF? and just change the argument of \arrow inside the tikz style

\documentclass{article}

\usepackage{tikz}
\RequirePackage{pgfplots}
\usetikzlibrary{shadows}
\usetikzlibrary{shapes}
\usetikzlibrary{decorations}
\usetikzlibrary{arrows,decorations.markings}         %new code

\usepackage{verbatim}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}

\setlength\PreviewBorder{5pt}

\begin{document}   
\tikzset{               %new code
    redarrows/.style={postaction={decorate},decoration={markings,mark=at position 0.1 with {\arrow[draw=red]{>}}},
           decoration={markings,mark=at position -0.4 with {\arrow[draw=red]{>}}},}}
\begin{tikzpicture}
    \begin{axis}[
            xmin=-1.5,xmax=2.5,ymin=-1.5,ymax=1.5,
            axis lines=center,
            ticks=none,
            unit vector ratio*=1 1 1,
           ]        
          \addplot [very thick, smooth, domain=(0:2*pi),redarrows] ({1.+cos(deg(x))},{sin(deg(x))});         %new code

      \addplot[only marks,mark=*] coordinates{(1,0)};
        \end{axis}
\end{tikzpicture}

\end{document}

enter image description here

Related Question