Graphics, Figures & Tables ⇒ Drawing partitions
Drawing partitions
This is only an example so I would like to be able to draw anything that looks like it with different values and partitions.
I have installed the pgf package but I don't want to go through the whole manual so I can do this one thing. Can someone guide me through how to do it or give an example of some code for e.g. 3 partitions?
Thanks in advance.
- Attachments
-
- partitions.jpg (5.14 KiB) Viewed 3397 times
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Drawing partitions
Sooner or later you will have study the manual. Some code off the top of my head.notnek wrote:[…] I have installed the pgf package but I don't want to go through the whole manual so I can do this one thing. […]
Code: Select all
\documentclass{minimal}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[thick,font=\small]
\path (0,0) node[circle,draw] (a) {1}
(1,0) node[circle,draw] (b) {2}
(2,0) node[circle,draw] (c) {3}
(3,0) node[circle,draw] (d) {4}
(4,0) node[circle,draw] (e) {5}
(5,0) node[circle,draw] (f) {6};
\draw (a) -- +(0,0.75) -| (d);
\draw (b) -- +(0,0.5) -| (c);
\draw (e) -- +(0,0.75) -| (f);
\end{tikzpicture}
\end{document}
Best regards and welcome to the board
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10