划分马尔可夫链的过渡态

划分马尔可夫链的过渡态

在此处输入图片描述我想用虚线斜线来划分马尔可夫链的过渡态。这些线不应该连接过渡态

答案1

像这样?

在此处输入图片描述

将来,你应该始终在你的问题中添加你迄今为止尝试过的方法以及你在解决问题时遇到的问题。从头开始编写代码并不好玩......你应该帮助我们帮助你......

无论如何,由于您是该领域的初学者,因此我确实例外并写了以下 MWE(用于练习):

\documentclass[tikz, border=3mm]{standalone}
\usetikzlibrary{automata,
                chains
                }
\begin{document}

    \begin{tikzpicture}[auto, semithick,
      node distance = 22mm,
        start chain = going right,
state/.append style = {thick, fill=gray!10,
                       inner sep=5pt, minimum width=2em,
                       font=\sffamily\Large,
                       on chain},
                       ]
\foreach \i in {0,...,3}
  \node (s\i)[state]    {\i};
\draw[->]   (s0) edge[bend left] node (a1) {$1$}   (s1)
            (s1) edge[bend left] node (a2) {$1/3$} (s2)
            (s2) edge[bend left] node (a3) {$3/4$} (s3)
%
            (s3) edge[bend left] node (b3) {$1$}   (s2)
            (s2) edge[bend left] node (b2) {$1/4$} (s1)
            (s1) edge[bend left] node (b1) {$2/3$} (s0);
% sloped lines crossing edges 
\draw (b1.west) -- (a1.east);
\draw (b2.west) -- (a2.east);
\draw (b3.west) -- (a3.east);
\end{tikzpicture}
\end{document}

附录: 由于所有边都向左弯曲,上面的 MWE 可以以稍微简洁的形式重写,其结果与上面相同:

    \begin{tikzpicture}[auto, semithick,
      node distance = 22mm,
        start chain = going right,
state/.append style = {thick, fill=gray!10,
                       inner sep=5pt, minimum width=2em,
                       font=\sffamily\Large,
                       on chain},
  every edge/.style = {draw, -{Stealth[bend]}, bend left}
  ]
\foreach \i in {0,...,3}
  \node (s\i)[state]    {\i};
\path   (s0) edge node (a1) {$1$}   (s1)
        (s1) edge node (a2) {$1/3$} (s2)
        (s2) edge node (a3) {$3/4$} (s3)
%
        (s3) edge node (b3) {$1$}   (s2)
        (s2) edge node (b2) {$1/4$} (s1)
        (s1) edge node (b1) {$2/3$} (s0);
% sloped lines crossing edges
\draw   (b1.west) -- (a1.east);
\draw   (b2.west) -- (a2.east);
\draw   (b3.west) -- (a3.east);
\end{tikzpicture}

使用上述两种 MWEbeamer应该没有问题。如果由于任何原因出现这种情况,请提出新问题(将包含 MWE)

相关内容