[Tex/LaTex] tikz: Draw horizontal line of some specified width

nodestikz-pgf

I wonder how to draw a horizontal line of some specified length. MWE is given below. Any help will be highly appreciated. Thanks

\documentclass[border=5mm]{standalone}
\usepackage{tikz}
\begin{document}

\begin{tikzpicture}

\node (a) at (0, 0) {Test \hrulefill{}};

\end{tikzpicture}

\end{document}

Best Answer

You can use line width to get a satisfactory line width. This is an example for this purpose,

\documentclass[border={5pt}]{standalone}
\usepackage{tikz}
\begin{document}

\begin{tikzpicture}
\foreach \x in {1,...,5}
\draw[line width=\x mm] (0,\x) -- (2,\x);
\end{tikzpicture}

\end{document}

and the result is

enter image description here