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

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

enter image description here

Would you advise me how to add such arrows?

share|improve this question

marked as duplicate by Claudio Fiandrino, mafp, Torbjørn T., Jubobs, T. Verron Apr 16 '13 at 8:55

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Have you checked this answer? –  g.kov Apr 16 '13 at 6:58
1  
    
See also tex.stackexchange.com/questions/1260/… –  Torbjørn T. Apr 16 '13 at 8:15

2 Answers 2

up vote 4 down vote accepted

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

share|improve this answer
    
is it possible to place the arrows based on polar coordinates like 1) at (radius of circle, angle=45) and 2) at (radius of circle, angle=225) so that position of arrows does not get effected when radius increases ? –  texenthusiast Apr 16 '13 at 8:30
    
It's possible that I'm completely missing your point, but if you draw the first arrow at position, say, 0.125, no matter how bigger or smaller the circle is the arrow will always point to the corresponding angle. –  dcmst Apr 16 '13 at 9:42

With PSTricks.

enter image description here

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-plot}
\begin{document}
\begin{pspicture}(-1,-3)(5,3)
    \psaxes[labels=none,ticks=none,linecolor=gray](0,0)(-1,-3)(5,3)
    \pscircle[dimen=middle](2.5,0){2}
    \psset{arrows=->,arrowinset=0,arcsep=-1.5\pslinewidth,linecolor=red}
    \psarc(2.5,0){2}{44}{46}
    \psarc(2.5,0){2}{-136}{-134}
\end{pspicture}
\end{document}

Warning:

I don't know how to change the arrow head color more elegantly.

share|improve this answer

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