I have a node with the shape rectangle split.
In it, the nodepart with "32" is the main part, the rest are annotations for it.
Question: How do I get the nodepart with "32" to be a square?
The other split parts should remain rectangular and be of the lowest possible height:
· so that's why I used \scalebox{0.25}{...}, I do not know, whether there is a better way or a more TikZ-like way....
· By the way: the value 0.25 does not have to be fixed.
\documentclass[margin=5pt, tikz]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes}
\begin{document}
\begin{tikzpicture}[font=\footnotesize\sffamily, very thin,
]
\node [rectangle split, rectangle split parts=7, draw, anchor=center,
draw, anchor=text,
inner ysep=0.5pt, %inner xsep=0.5pt,
minimum width=5mm, minimum height=5mm, % seems to have no effect...
rectangle split part fill={brown, orange, yellow, green, blue!33, red, lightgray},
name=mynode]{
\nodepart{four}\scalebox{0.25}{high (3/9)}
\nodepart{five}\scalebox{0.25}{even (1/9)}
\nodepart{six}\color{white}32
\nodepart{seven}\scalebox{0.225}{1. Place}};
\draw[<-, thick, purple] (mynode.six east) -- +(0.3,0) node[right, align=left, draw, font=\tiny, inner sep=1pt]{How to get a \ \bfseries squared 'nodepart' \ here? \
(The others can \ stay rectangled.)};
\end{tikzpicture}
\end{document}





text heightandtext depthdon't even work for nodeparts which makes an automatic approach very hard. Does it need to be a rectangle split node? We can do almost the same with a matrix and individual nodes but the matrix can't be transformed (not even rotated) which the rectangle split shape would allow. – Qrrbrbirlbel May 01 '23 at 21:40