创建一个美观的双角色标准形式游戏,例如《囚徒困境》

创建一个美观的双角色标准形式游戏,例如《囚徒困境》

TikZ我在调整代码以获得对称输出矩阵时遇到了困难;我猜这*是正确的块在某种程度上更高的原因?

\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}

答案1

你可以“假装” 不在*这里(即:它不占用空间),只需放置\smash{\rlap{*}}而不是 即可*。这样,不仅所有单元格都具有相同的大小,而且 还将2.2与 垂直对齐1.4

结果

答案2

考虑阅读,只需指定text height=1emelement/.style您就会获得:

在此处输入图片描述

答案3

您可以尝试设置节点的锚点element/.style={ anchor=north east,element/.style={ anchor=center,

相关内容