TikZ: draw line thickness less than 0.1 mm

You can specify the line width. Here is a zoomed in view of the output so that one can see the difference:

enter image description here

Notes:

  • As John Kormylo pointed out the tikz-pgf manual says

    Line width: The “thickness” of the line. A width of 0 is the thinnest width renderable on the device. On a high-resolution printer this may become invisible and should be avoided. A good choice is 0.4pt, which is the default.

    Not really sure what 0mm means in this case, but it seems to be a non-zero width :-)

  • Obviously at some point the size difference won't be noticeable at all, especially in a print edition.

Code:

\documentclass{article}
\usepackage{siunitx}
\usepackage{tikz}

\begin{document}

\begin{tikzpicture}[yscale=0.5]
    \draw [line width=0.25mm, red ] (0,-1) -- (2,-1) node [right] {\SI{0.25}{\milli\meter}};;
    \draw [line width=0.1mm,  blue] (0,-2) -- (2,-2) node [right] {\SI{0.10}{\milli\meter}};;
    \draw [line width=0.05mm, red ] (0,-3) -- (2,-3) node [right] {\SI{0.05}{\milli\meter}};
    \draw [line width=0.01mm, blue] (0,-4) -- (2,-4) node [right] {\SI{0.01}{\milli\meter}};
    \draw [line width=0mm,   black] (0,-5) -- (2,-5) node [right] {\SI{0.0}{\milli\meter}};
\end{tikzpicture}

\end{document}

A PSTricks solution:

\documentclass{article}

\usepackage{pstricks-add}
\usepackage{siunitx}

\begin{document}

\begin{pspicture}(6.25,5.2)
  \multido{\rA = 0.1+-0.01, \rB = 0.1+0.5}{11}{
    \psline[linewidth = \rA mm](0,\rB)(5,\rB)
    \uput[0](5,\rB){\texttt{linewidth} = \SI[round-mode = places, round-precision = 2]{\rA}{\mm}}
  }
\end{pspicture}

\end{document}

output

You specify the width of the line with the option linewidth = <length>.

P.S. As can be seen, the line width is too small to distinguish when using PSTricks, so that is not a good tool in this case. (I can't believe I'm saying that.)

Tags:

Tikz Pgf