5

I was wondering if it is possible to let the line's width dynamically increase from its start to its end. I found such an illustration in a book: enter image description here

I am a TikZ noob but what I came up with would be the following starting point:

\documentclass{standalone}
\usepackage{xcolor}
\definecolor{darkred}{cmyk}{0,.81,.75,.37}
\usepackage{tikz}
\usetikzlibrary{arrows}

\begin{document}
\begin{tikzpicture}
\coordinate (S) at (1,1);
\coordinate (E) at (5,1);

\draw [darkred,dashed,bend angle=30,bend left,->,>=triangle 45,line width=1.5pt] (S) to (E);

\end{tikzpicture}
\end{document}

which yields the following result: enter image description here

Does anybody know if it is possible to achive the desired result?

2

Someone could make it prettier, but something with the decorations and markings libraries

enter image description here

\documentclass{article}
\usepackage{xcolor}
\definecolor{darkred}{cmyk}{0,.81,.75,.37}
\usepackage{tikz}
\usetikzlibrary{arrows,decorations,decorations.markings}
\newdimen\zzlen
\zzlen=.6pt
\begin{document}
\begin{tikzpicture}[decoration={markings,
      mark=between positions 0 and .85step 9pt
         with { \node [fill=red, 
                              ,transform shape] {%
\textcolor{red}{\rule{.5pt}{%
  \pgfkeysvalueof{/pgf/decoration/mark info/sequence number}\zzlen}}};}}]
\coordinate (S) at (1,1);
\coordinate (E) at (5,1);

\draw [white,bend angle=30,bend left,-{>[red]},>=triangle 45,
line width=3pt,postaction={decorate}]
(S)to (E);



\end{tikzpicture}

\end{document}
2

This is a simple construction that is compatible with dash pattern.

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing}

\begin{document}

\tikzset{
    fan/.style={
        decorate,
        decoration={
            show path construction,
            curveto code={
                \foreach\i in{1,...,50}{
                    \draw[dash pattern=on1off2on2off2on4off2on8off2on3off2on2off2]
                         [shift={(\tikzinputsegmentfirst)}][scale=-1][rotate=\i/10]
                         [shift={(\tikzinputsegmentfirst)}][scale=-1]
                         (\tikzinputsegmentfirst)..controls(\tikzinputsegmentsupporta)
                              and(\tikzinputsegmentsupportb)..(\tikzinputsegmentlast);
                }
            }
        }
    }
}

\begin{tikzpicture}
    \coordinate (S) at (1,1);
    \coordinate (E) at (5,1);
    \draw[bend angle=30,bend left,fan](S)to(E);
\end{tikzpicture}

\end{document}

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.