如何绘制博弈论中使用的图表

如何绘制博弈论中使用的图表

有人能告诉我如何绘制下面的内容(以最不花哨的方式)吗?

在此处输入图片描述

答案1

显然,最简单的方式不需要任何包。

\documentclass{article}
\begin{document}
\setlength\unitlength{0.5cm}
\newcount\tickcount
\begin{picture}(10,17)(-5,-8)
  \put(-3,-7){\line(0,1){16}}
  \put( 3,-7){\line(0,1){16}}
  \tickcount=-6
  \loop
    \put(-3,\tickcount){\line( 1,0){0.5}}
    \put( 3,\tickcount){\line(-1,0){0.5}}
    \put(-4.2,\tickcount){\lower3pt\hbox{\makebox[1.5em][r]{$\the\tickcount$}}}
    \put(   3,\tickcount){\lower3pt\hbox{\makebox[1.5em][r]{$\the\tickcount$}}}
    \advance\tickcount by 2
  \ifnum\tickcount<10
  \repeat
  \put(-4,-8){Colin $A$}
  \put( 2,-8){Colin $B$}
  \put(-3,-5){\line(1,2){6}} \put(-1,4){Rose $C$}
  \put(-3, 0){\line(3,1){6}} \put( 1.3,0.6){Rose $B$}
  \put(-3, 2){\line(6,-5){6}}\put( 1.3,-1.3){Rose $A$}
\end{picture}
\end{document}

在此处输入图片描述

答案2

再次使用 TikZ 及其库quotes

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{quotes}

\begin{document}
    \begin{tikzpicture}[
every edge quotes/.style = {pos=0.75, sloped, font=\small, auto}
                        ]
\draw (0,4) -- (0,-3) node[below=1mm] {Colin A};
\draw (4,4) -- (4,-3) node[below=1mm] {Colin B};
\foreach \i in {-6,-4,...,8}
{
    \draw (0.1,0.5*\i) -- + (-0.1,0) node[left]  {$\i$};
    \draw (3.9,0.5*\i) -- + ( 0.1,0) node[right] {$\i$};
}
\draw   (0,-2.5) edge ["Rose $C$"]     (4, 2.5)
        (0, 0.0) edge ["Rose $B$" ']   (4, 1.0)
        (0, 1.0) edge ["Rose $A$"]     (4,-1.5);
    \end{tikzpicture}
\end{document}

在此处输入图片描述

答案3

起点如下tikz

在此处输入图片描述

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{decorations}
\begin{document}
  \begin{tikzpicture}
    \draw (0,8) -- (0,-6);
    \foreach \i in {-6,-4,...,8}
      \draw (0.1,\i) -- + (-0.2,0) node[left] {$\i$};
      \node at (0,-7){Colin A};
    \draw (3,8) -- (3,-6);
    \foreach \i in {-6,-4,...,8}
      \draw (2.9,\i) -- + (0.2,0) node[right] {$\i$};
      \node at (3,-7){Colin B};
    \draw (0,-5) -- (3,5);
    \draw(0,0) -- (3,2);
    \draw(0,2) -- (3,-3);
  \end{tikzpicture}
\end{document}

相关内容