I'm trying to fit the nodes one
and two
belonging to a parted node, in order to encapsulate them inside a rectangle with a different color:
\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{chains}
\usetikzlibrary{shapes}
\usetikzlibrary{shapes.multipart}
\usetikzlibrary{fit}
\begin{document}
\begin{tikzpicture}
\node (qs) [draw,font=\tiny,
rectangle split,
rectangle split parts=3,
text centered,
align=center,
] at (-2.3,0) {%
\nodepart{one} one
\nodepart{two} two
\nodepart{three} three
};
\node[fit=(qs.one above left)(qs.two),rectangle,draw=red,line width=1mm] {};
\node[fit=(qs.one north west)(qs.two),rectangle,draw=red,line width=1mm] {};
\end{tikzpicture}
\end{document}
By the way, it recognizes neither above left
nor north west
. What is the best solution to draw this border with the correct coordinates?
Package PGF Math Error: Unknown function `one' (in 'one above left'). ...qs.two),rectangle,draw=red,line width=1mm]
Package PGF Math Error: Unknown function `one' (in 'one north west'). ...qs.two),rectangle,draw=red,line width=1mm]
.one north west
... instead it you should use.north west
.