I want to create a diagram with tikz in which entries overdraw more than one column. I solved this problem already with the fit package. But now there is a problem with the look of the nodes within the matrix. The text in the multicolumn rectangles is not centered. How can I solve this Problem?
\documentclass[
a4paper,
12pt,
headings=normal, % small
]{scrartcl}
\usepackage{tikz}
\usetikzlibrary{positioning,arrows,chains,matrix,scopes,fit}
\begin{docoument}
\begin{tikzpicture}
\tikzset{element/.style={rectangle,
inner sep=0pt,
minimum width=15mm,
very thick,
draw = black,
top color=blue!20!white!20, bottom color=blue!70!white,
font=\tiny,
}}
\tikzset{element2/.style={rectangle,
minimum size=5mm,
very thick,
draw = black,
top color=blue!20!white!20, bottom color=blue!70!white,
font=\tiny
}}
\tikzset{point/.style={circle,
inner sep=0pt,
minimum size=2pt,
fill=red
}}
\matrix (table) [%
matrix of nodes,
nodes in empty cells,
row sep=4mm,column sep=5mm,
nodes={text centered}
] {%
\node(p1)[point]{}; & & \node(p2)[point]{}; & & & \node(p3)[point]{}; & & & \\
& & & & & & & &\\
& & & & & & \node()[element2]{$+1$}; & & \\
& & & \node(p4)[point]{}; & & & & & \node(p5)[point]{}; \\
& & & & & & & & \\
\node(p6)[point]{}; & & & \node(p7)[point]{}; & & & & & \\
& \node(p8)[point]{}; & & & & & \node(p9)[point]{}; & & \\
& & & & & & & & \\
\node(p10)[point]{}; & & & & & & & & \\
};
\node[fit=(table-2-2)(table-2-4),element]{label1};
\node[fit=(table-2-7)(table-2-9),element]{label2};
\node[fit=(table-5-2)(table-5-3),element]{label3};
\node[fit=(table-5-6)(table-5-7),element]{label4};
\node[fit=(table-7-4)(table-7-5),element]{label5};
\node[fit=(table-8-4)(table-8-5),element]{label6};
\end{tikzpicture}
\end{docoument}

heightof the rectangle and thetext heightwith something likeminimum height=2ex, text height=1.2ex,in theelementstyle? – Claudio Fiandrino Jan 18 at 10:21:)– Claudio Fiandrino Jan 18 at 11:02