How to make this rectangle a node (TikZ)?

I have drawn a rectangle with a fixed position:

$\begin{tikzpicture} \draw[thick] (3,1) rectangle (5,3); \end{tikzpicture}$


I would like to make it a node with a name (for instance rec), so that other elements later could be positioned with regards to it, for instance:

\node (elli) [ellipse, below=1cm of rec] {...};


Does anyone know how to make the rectangle above a node?

-

1 Answer

You can specify the minimum height and minimum width for a node. In conjunction with draw, you'll end up with a rectangle with the specified dimensions:

\node (rect) at (4,2) [draw,thick,minimum width=2cm,minimum height=2cm] {};

-
Here, iiuc (rect) is the label, so what indicates the shape ? Is rectangle simply the default for draw ? –  Nikana Reklawyks Mar 16 at 6:40
@Nikana: yes, exactly, rectangle is the default shape. –  Jake Mar 16 at 7:10
Actually explicitly setting [rectangle] is also possible, to restore the default if it was overriden. –  Joost May 27 at 18:12