图形样式

图形样式

我如何绘制 n-1 个小的 etat?对于第二幅图,我如何才能得到 fleche 中的数字

\begin{figure}[!h]
\begin{center}

\begin{tikzpicture}[>=stealth,line width=0.8pt]
%les sommets
\draw (0,0)node (0)[circle,draw,fill=cyan!30]{$\bf 0$};
\draw (2,0)node (1)[circle,draw,fill=cyan!30]{$\bf 1$};
\draw (4,0)node (2)[circle,draw,fill=cyan!30]{$\bf 2$};
\draw (6,0)node (3)[circle,draw,fill=cyan!30]{$\bf 3$};
\draw (9,0)node (n-1)[circle,draw,fill=cyan!30]{$\bf n-1$};
\draw (11,0)node (n)[circle,draw,fill=cyan!30]{$\bf n$};

%les fleches
\draw [->] (0)to [bend right] (1);
\draw [->] (1)to [bend right] (0);
\draw [->] (1)to [bend right] (2);
\draw [->] (2)to [bend right] (1);
\draw [->] (2)to [bend right] (3);
\draw [->] (3)to [bend right] (2);
\draw [->] (n-1)to [bend right] (n);
\draw [->] (n)to [bend right] (n-1);
\node at (1,1) {$\lambda_{0}$};
\node at (3,1) {$\lambda_{1}$};
\node at (5,1) {$\lambda_{2}$};
\node at (10,1) {$\lambda_{n-1}$};
\node at (1,-1) {$\mu_{1}$};
\node at (3,-1) {$\mu_{2}$};
\node at (5,-1) {$\mu_{3}$};
\node at (10,-1) {$\mu_{n}$};
\end{tikzpicture}
\end{center}
\caption{Graphe de processus de naissance et de mort}
\end{figure}

\begin{center}
\begin{figure}[!h]
\begin{center}
\begin{tikzpicture}[>=stealth,line width=0.8pt]
%les sommets
\draw (0,3)node (a)[circle,draw,fill=cyan!30]{$\bf a$};
\draw (3,3)node (b)[circle,draw,fill=cyan!30]{$\bf b$};
\draw (3,0)node (c)[circle,draw,fill=cyan!30]{$\bf c$};
\draw (0,0)node (d)[circle,draw,fill=cyan!30]{$\bf d$};
%les fleches
%\draw [->] (a)to [bend right] (a);
\draw [->] (b)to [bend right] (c);
\draw [->] (b)to [bend right] (d);
%\draw [->] (c)to [bend right] (c);
\draw [->] (c)to [bend right] (d);
%\draw [->] (d)to [bend right] (d);
\draw [->] (d)to [bend right] (c);
%les fleches rebouclantes
\draw[->] (a)..controls ++(110:1)and ++(80:1)..(a);
\draw[->] (c)..controls ++(110:1)and ++(80:1)..(c);
\draw[->] (d)..controls ++(110:1)and ++(80:1)..(d);
\end{tikzpicture}
\end{center}
\caption{Graphe de transition associé à la chaîne de Markov, de matrice P}
\end{figure}
\end{center}

答案1

对于第一个图表:

在此处输入图片描述

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{chains, positioning, quotes}

    \begin{document}
\begin{figure}[!h]
\centering
    \begin{tikzpicture}[
    line width=0.8pt,
    start chain=going right,
    node distance=12mm,
    every edge/.append style={bend left,-stealth, auto=left},
                    ]
%les sommets
    \begin{scope}[every node/.style = {circle,draw,fill=cyan!30,
                                       minimum size=6ex,inner sep=1pt, % <-- defined size of nodes
                                       on chain}] 
\node (0)   {$\mathbf{0}$};
\node (1)   {$\mathbf{1}$};
\node (2)   {$\mathbf{2}$};
\node (3)   {$\mathbf{3}$};
\node (n-1) {$\mathbf{n{-}1}$};
\node (n)   {$\mathbf{n}$};
    \end{scope}
%
\draw [->]  (0) edge ["$\lambda_{0}$"]  (1)
            (1) edge ["$\mu_{1}$"]      (0)
            (1) edge ["$\lambda_{1}$"]  (2)
            (2) edge ["$\mu_{¸2}$"]     (1)
            (2) edge ["$\lambda_{2}$"]  (3)
            (3) edge ["$\mu_{3}$"]      (2)
            (n-1) edge ["$\lambda_{n-1}$"](n)
            (n) edge ["$\mu_{n}$"]      (n-1);
    \end{tikzpicture}
\caption{Graphe de processus de naissance et de mort}
\end{figure}
    \end{document}

第二个:

在此处输入图片描述

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{chains, positioning, quotes}

    \begin{document}
\begin{figure}[!h]
\centering
    \begin{tikzpicture}[
    line width=0.8pt,
    node distance=22mm,
    every node/.style = {circle,draw,fill=cyan!30,
                         minimum size=4ex,inner sep=1pt},
    every edge/.append style={bend left=30,-stealth}
                 ]
%les sommets
\node (a)               {$\mathbf{a}$};
\node (b)[right=of a]   {$\mathbf{b}$};
\node (c)[below=of a]   {$\mathbf{c}$};
\node (d)[below=of b]   {$\mathbf{d}$};
%les fleches
\draw   (a) to [out= 60,in=120,min distance=9mm]    (a)
        (b) edge [bend right]   (c) 
        (b) edge                (d) 
        (c) to [out=150,in=210,min distance=9mm]    (c)
        (c) edge                (d) 
        (d) edge                (c)
        (d) to [out= 30,in=330,min distance=9mm]    (d);
\end{tikzpicture}
\caption{Graphe de transition associé à la chaîne de Markov, de matrice P}
\end{figure}    

相关内容