# Problem setting rectangle size in tikz picture

I have a rectangle in tikzpicture that appears to have a minimum size that it can be set to as when I try to reduce the size further it just becomes a square and will not get any smaller. I am trying to make the node width the same as the edge below it in the image.

For example:

\begin{tikzpicture}
[->,  thick, scale=.5,
rectangle1/.style={rectangle, fill=red,  minimum width=.05cm, minimum height= .2cm},
no node/.style={circle, minimum size=0cm, inner sep=0pt}
]
\node[no node] (1) at (0,0) {};
\node[no node] (2) at (10,0) {};
\node [rectangle1, above] (A) at (5,0) {};

\path [-]
(1) edge[red] node{} (2)
;
\end{tikzpicture}


However, when I change my settings in rectangle1/.style, and reduce the width and height there is no change in the result.

Is there a minimum size the rectangle node can be set at? And if so, can anyone suggest a different node type that I could use?

• Does adding transform shape to the tikzpicture options gives you what you want ? Apr 29, 2018 at 15:00

In order to apply a transformation such as scale to a tikz node, one must active the transform shape option. By default tikz does not apply transformations to nodes.
See pgfmanual version 3.0.1a p 234 Section 17.7 for more information.