Dash pattern that starts with space

You can shift the dash pattern such that it skips the first on part. For the definition of the dash patterns you can search the tikz.code.tex file. For quick reference;

\tikzstyle{dashed}=                  [dash pattern=on 3pt off 3pt]
\tikzstyle{densely dashed}=          [dash pattern=on 3pt off 2pt]
\tikzstyle{loosely dashed}=          [dash pattern=on 3pt off 6pt]

So to start with off you need to shift the dash pattern either 3pt or -3pt or multiples of them. Then you can create your own mydashed via

\documentclass[tikz]{standalone}
\begin{document}
\begin{tikzpicture}[mydashed/.style={dashed,dash phase=3pt}]
\draw[very thin] (0,-1) -- (0,1);
\draw[ultra thick] (-2,0) -- (0,0);
\draw[ultra thick,mydashed,->] (0,0) -- (2,0);
\draw[solid,mydashed,->] (0,-0.5) -- (2,-0.5);
\draw[ultra thin,mydashed,->] (0,-0.25) -- (2,-0.25);
\end{tikzpicture}
\end{document}

enter image description here

To draw the combined vector in one go, depending on what you need, you can use a decoration. If it is always a known portion of the vector is dashed (in terms of percentage etc.) it is relatively easy. Otherwise it might need some work.


You can use shorten <=<length> so that the line will start to be drawn after the specified length:

\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}

\draw[very thin] (0,-1) -- (0,1);
\draw[ultra thick] (-2,0) -- (0,0);
\draw[ultra thick,dashed,->,shorten <=3] (0,0) -- (2,0);

\end{tikzpicture}
\end{document}

enter image description here


Some tweek with dash pattern:

\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}

\draw[very thin] (0,-1) -- (0,1);
\draw[ultra thick] (-2,0) -- (0,0);
\draw[ultra thick,dash pattern=on 0pt off 3pt on 3pt off -1pt,->] (0,0) -- (2,0);

\end{tikzpicture}
\end{document}

enter image description here

Tags:

Tikz Pgf