2

I am trying to re-orient the decorations on two pathsenter image description here so that the arrows on the bottom one face the other way. I name the paths as follows

 \begin{tikzpicture} [decoration={markings,
                mark=at position 1cm with {\arrow[line width=1pt]{>}},
                mark=at position 5cm with {\arrow[line width=1pt]{>}}}]

                \path[draw, line width=0.4, postaction=decorate,
                    name path=contour1]
                    plot[smooth] coordinates
                    {(1.3,0.1)(1.1,1.7)(-1.2,1.4)(-.9,0.1)} -- (1.3,0.1)
                    -- cycle;
                \path[draw, line width=0.4, postaction=decorate,
                    name path=contour2]
                    plot[smooth] coordinates
                    {(1.3,-0.1)(1.1,-1.7)(-1.2,-1.4)(-.9,-0.1)} -- (1.3,-0.1)
                    -- cycle;
        \end{tikzpicture}

However, I don't know how to make the decorations appear on only one path.

  • 1
    Welcome to TeX.SE. You could create a separate style for the decoration and apply to the desired path. But your code is only a code snippet which is useful in explanations. It is always best to compose a fully compilable MWE that illustrates the problem including the \documentclass and the appropriate packages so that those trying to help don't have to recreate it. This is especially important for tikz as there are numerous libraries. – Peter Grill Dec 12 '15 at 20:20
1

Is this what you need? It's the easiest way: set a style, here called mymark, with a single argument. You can make them two or more, but in your case one was sufficient.

Output

example image

Code

\documentclass{standalone}
\usepackage{tikz}

\usetikzlibrary{intersections,decorations.markings}

\tikzset{
    mymark/.style={decoration={markings,
                mark=at position 1cm with {\arrow[line width=1pt]{#1}},
                mark=at position 5cm with {\arrow[line width=1pt]{#1}}}}
}

\begin{document}
\begin{tikzpicture}

    \path[draw, mymark={>}, line width=0.4, postaction=decorate, name path=contour1]
        plot[smooth] coordinates
        {(1.3,0.1)(1.1,1.7)(-1.2,1.4)(-.9,0.1)} -- (1.3,0.1) -- cycle;

    \path[draw, mymark={<},line width=0.4, postaction=decorate, name path=contour2]
        plot[smooth] coordinates
        {(1.3,-0.1)(1.1,-1.7)(-1.2,-1.4)(-.9,-0.1)} -- (1.3,-0.1) -- cycle;

\end{tikzpicture}
\end{document}
| improve this answer | |

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.