3

Is there an easy way to control the line width (and inevitably the line distance) of a pattern decoration?

I want a uniform line hatching, e.g. red / blue, with line width, say 3mm.

BTW: I need this for a large number of cells, so it would be good to use the patterns library to solve this, as opposed to drawing in manually.

enter image description here

\documentclass[tikz, border=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{patterns}

\begin{document} \begin{tikzpicture}[font=\Huge, Deco/.style={postaction={pattern=north west lines, %line width=6mm, ultra thick, % no effect pattern color=blue}}, ] \node[Deco, fill=red, draw, minimum size=5cm]{A}; \end{tikzpicture} \end{document}

cis
  • 8,073
  • 1
  • 16
  • 45

1 Answers1

4

I think the easiest way is to use the patterns.meta library:

enter image description here

\documentclass[tikz, border=5mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{patterns.meta}

\begin{document} \begin{tikzpicture}[font=\Huge, Deco/.style={postaction={ pattern={ Lines[angle=-45, distance=6mm, line width=3mm]% <--- ! }, pattern color=blue, }}, ]

\node[Deco, fill=red, draw, minimum size=5cm]{A}; \end{tikzpicture} \end{document}

cis
  • 8,073
  • 1
  • 16
  • 45