Skip to main content
Became Hot Network Question
Tweeted twitter.com/StackTeX/status/1264164202396233731
deleted 4 characters in body
Source Link
Martin Scharrer
  • 270.1k
  • 66
  • 795
  • 956

I have some automatic placed nodes which should be filled with a pattern. However, I noticed that the pattern offset depends on the node position, which makes the nodes looks different.

Minimal example:

\documentclass\[tikz\documentclass[tikz,border=5mm\]border=5mm]{standalone} \usetikzlibrary{patterns} \begin{document} \begin{tikzpicture} \foreach \n in {0,1,...,5} { \node \[rectangle[rectangle,draw,minimum width=1cm,minimum height=1cm,pattern=north west lines\]lines] at (1.1*\n cm, 0) {}; \node \[rectangle[rectangle,draw,minimum width=1cm,minimum height=1cm,pattern=dots\]pattern=dots] at (1.1*\n cm, 1.1) {}; } \end{tikzpicture} \end{document} 

How can I achieve that the patterns are drawn identical for every node? I think I have to adjust some pattern origin for that.

I have some automatic placed nodes which should be filled with a pattern. However, I noticed that the pattern offset depends on the node position, which makes the nodes looks different.

Minimal example:

\documentclass\[tikz,border=5mm\]{standalone} \usetikzlibrary{patterns} \begin{document} \begin{tikzpicture} \foreach \n in {0,1,...,5} { \node \[rectangle,draw,minimum width=1cm,minimum height=1cm,pattern=north west lines\] at (1.1*\n cm, 0) {}; \node \[rectangle,draw,minimum width=1cm,minimum height=1cm,pattern=dots\] at (1.1*\n cm, 1.1) {}; } \end{tikzpicture} \end{document} 

How can I achieve that the patterns are drawn identical for every node? I think I have to adjust some pattern origin for that.

I have some automatic placed nodes which should be filled with a pattern. However, I noticed that the pattern offset depends on the node position, which makes the nodes looks different.

Minimal example:

\documentclass[tikz,border=5mm]{standalone} \usetikzlibrary{patterns} \begin{document} \begin{tikzpicture} \foreach \n in {0,1,...,5} { \node [rectangle,draw,minimum width=1cm,minimum height=1cm,pattern=north west lines] at (1.1*\n cm, 0) {}; \node [rectangle,draw,minimum width=1cm,minimum height=1cm,pattern=dots] at (1.1*\n cm, 1.1) {}; } \end{tikzpicture} \end{document} 

How can I achieve that the patterns are drawn identical for every node? I think I have to adjust some pattern origin for that.

Source Link
Martin Scharrer
  • 270.1k
  • 66
  • 795
  • 956

Correcting TikZ pattern offsets

I have some automatic placed nodes which should be filled with a pattern. However, I noticed that the pattern offset depends on the node position, which makes the nodes looks different.

Minimal example:

\documentclass\[tikz,border=5mm\]{standalone} \usetikzlibrary{patterns} \begin{document} \begin{tikzpicture} \foreach \n in {0,1,...,5} { \node \[rectangle,draw,minimum width=1cm,minimum height=1cm,pattern=north west lines\] at (1.1*\n cm, 0) {}; \node \[rectangle,draw,minimum width=1cm,minimum height=1cm,pattern=dots\] at (1.1*\n cm, 1.1) {}; } \end{tikzpicture} \end{document} 

How can I achieve that the patterns are drawn identical for every node? I think I have to adjust some pattern origin for that.