I am having difficulties in adjusting the TikZ
code to get a symmetrical output matrix; I guess the *
is the reason the right block is somehow higher?
\documentclass[a4paper,fontsize=12pt,a4paper,DIV=10,BCOR=10mm,twoside,titlepage=false,openany,pagesize]{scrbook}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{blindtext}
\setkomafont{disposition}{\normalfont\bfseries}
\usepackage{tikz}
\usetikzlibrary{calc,matrix,positioning}
\begin{document}
\begin{figure}[h]
\centering
\caption{Collective action problem in the Prisoners' Dilemma}
\label{Collective action problem in the Prisoners' Dilemma}
\begin{tikzpicture}[element/.style={ minimum width=1.75cm,minimum height=0.85cm}]
\matrix (m) [matrix of nodes,nodes={element},column sep=-\pgflinewidth, row sep=-\pgflinewidth,]{
& Cooperate & Defect \\
Cooperate & |[draw]|3,3 & |[draw]|1,4 \\
Defect & |[draw]|4,1 & |[draw]|2,2* \\
};
\node[above=0.25cm] at ($(m-1-2)!0.5!(m-1-3)$){\textbf{Actor A}};
\node[rotate=90] at ($(m-2-1)!0.5!(m-3-1)+(-1.25,0)$){\textbf{Actor B}};
\node [below=1.5cm, align=flush center,text width=8cm]
{\begin{scriptsize}
Number left (right) of comma refers to A's (B's) preference ordering (1 = worst outcome; 4 = best outcome). * indicates the equilibrium.
\end{scriptsize}
};
\end{tikzpicture}
\end{figure}
\end{document}
Best Answer
You can "pretend" that the
*
is not here (i.e: it takes no space) by putting\smash{\rlap{*}}
instead of simply*
. This way not only all cells will have the same size, but also the2.2
will be vertically aligned with1.4
: