Drawing a long dashed line

linemacrostikz-pgf

In this link here there are several styles of dashed lines. But none of them shows a long dashed format. How can I draw a long dashed line, for example, by a newcommand or TikZ? (A picture the same as below one.)

Enter image description here

I mean an arbitrary size for any slice and arbitrary space between them.

Best Answer

Yes, even with many lengths in a pattern:

\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}

\draw [very thick,dash pattern={on 10pt off 2pt on 5pt off 2pt}] (0,0) -- (6,0);
\end{tikzpicture}

\end{document}

enter image description here

Related Question