Hi guys
I wish to visualize a lattice in my document (i.e. a grid). What I am searching for is something like the attached picture.
I've been toying a little with Tikz, but I did not get a useful result. Mainly because I think the text inside the circles is too big. I have tried using [font=\small], but it' still a little too big.
Do you have any suggestion on how I should create this?
Sincerely,
Niles.
Graphics, Figures & Tables ⇒ Drawing a lattice/grid
Drawing a lattice/grid
- Attachments
-
- grid.PNG (3.79 KiB) Viewed 5801 times
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Drawing a lattice/grid
What you want is a matrix. For this special purpose with math expressions you have to use the »matrix« library. See Section 31 (Matrix Library, p. 278ff) of the pgf/tikZ manual and the code below.
Please give final feedback to provided solutions. Until now you haven't done that to none of your requests.
Best regards
Thorsten
Code: Select all
\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\usetikzlibrary{matrix}
\begin{document}
\begin{tikzpicture}
\matrix [
matrix of math nodes,
nodes={circle,draw},
minimum size=1.2cm,
inner sep=1mm,
column sep=5mm,
row sep=5mm
]
{
1 & 2 & \vphantom{1}\ldots & N_x \\
N_{x+1} & N_{x+2} & \vphantom{1}\ldots & \vphantom{1}\ldots \\
\phantom{1} & \vphantom{1}\ldots & \vphantom{1}\ldots & \phantom{1} \\
};
\end{tikzpicture}
\end{document}
Best regards
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Drawing a lattice/grid
Thanks. That is exactly what I am looking for.
Have a nice day.
Have a nice day.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Drawing a lattice/grid
There's not much left of the day. It's 11:25pm here.niles wrote:[...] Have a nice day.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Drawing a lattice/grid
localghost wrote:There's not much left of the day. It's 11:25pm here.niles wrote:[...] Have a nice day.

Well, in that case have a nice evening