無論如何,您是否可以清理它,以便清楚地看出 p$_1$ 和 p$_3$ 在從 t=1 到 t=2 的各自分支上是不同的?
移動任一分支的位置看起來都很愚蠢,而且我沒有足夠的經驗來找到正確的命令來更清楚地表明它們各自的分支不重疊。
代碼:
\documentclass[12pt]{article}
\usepackage{lipsum,wrapfig,graphicx,scrextend,sectsty,verbatim,tikz,tkz-berge}
\begin{document}
\begin{tikzpicture}[scale=3]
\GraphInit[vstyle=Classic]
\SetUpVertex[Lpos=-90]
\tikzset{VertexStyle/.style = {shape=circle, fill=black, minimum size=3pt,inner sep=0pt}
}
%t=1
\Vertex[x=0,y=1.5]{S$_0$}
\Vertex[x=1,y=1.5]{mS$_0$}
\Vertex[x=1,y=2]{uS$_0$}
\Vertex[x=1,y=1]{dS$_0$}
%t=2
\Vertex[x=2,y=2.5]{u$^2$S$_0$}
\Vertex[x=2,y=2]{umS$_0$}
\Vertex[x=2,y=1.5]{m$^2$S$_0$}
\Vertex[x=2,y=1]{dmS$_0$}
\Vertex[x=2,y=.5]{d$^2$S$_0$}
%t=1
\Edge[label = $\widetilde{p}_1$](S$_0$)(uS$_0$)
\Edges[label = $\widetilde{p}_2$](S$_0$,mS$_0$)
\Edges[label = $\widetilde{p}_3$](S$_0$,dS$_0$)
%t=2
%u
\Edges[label = $\widetilde{p}_1$](uS$_0$,u$^2$S$_0$)
\Edges[label = $\widetilde{p}_2$](uS$_0$,umS$_0$)
\Edges[label = $\widetilde{p}_3$](uS$_0$,m$^2$S$_0$)
%m
\Edges[label = $\widetilde{p}_3\,\widetilde{p}_1$]
(mS$_0$,umS$_0$)
\Edges[label = $\widetilde{p}_2$](mS$_0$,m$^2$S$_0$)
\Edges[label = $\widetilde{p}_3$](mS$_0$,dmS$_0$)
%d
\Edges[label = $\widetilde{p}_3\,\widetilde{p}_1$](dS$_0$,m$^2$S$_0$)
\Edges[label = $\widetilde{p}_2$](dS$_0$,dmS$_0$)
\Edges[label = $\widetilde{p}_3$](dS$_0$,d$^2$S$_0$)
\end{tikzpicture}
\end{document}
答案1
\documentclass[12pt]{article}
\usepackage{lipsum,wrapfig,graphicx,scrextend}
\usepackage{sectsty,verbatim,tikz,tkz-berge,amsmath,amsthm,amssymb,amsfonts,tkz-graph}
\usetikzlibrary{trees,fit,shapes,arrows, calc}
\begin{document}
\begin{quote}
\begin{tikzpicture}[scale=3]
\GraphInit[vstyle=Classic]
\SetUpVertex[Lpos=-90]
\tikzset{VertexStyle/.style = {shape=circle, fill=black, minimum size=3pt,inner sep=0pt}
}
%t=1
\Vertex[x=0,y=1.5]{S$_0$}
\Vertex[x=1,y=1.5]{mS$_0$}
\Vertex[x=1,y=2]{uS$_0$}
\Vertex[x=1,y=1]{dS$_0$}
%t=2
\Vertex[x=2,y=3]{u$^2$S$_0$}
\Vertex[x=2,y=2.5]{umS$_0$}
\Vertex[x=2,y=1.]{m$^2$S$_0$}
\Vertex[x=2,y=.5]{dmS$_0$}
\Vertex[x=2,y=0]{d$^2$S$_0$}
\Vertex[x=2,y=1.75]{udS$_0$}
%t=1
\tikzset{EdgeStyle/.style={->,font=\scriptsize,above,sloped,midway}}
\Edge[label = $\widetilde{p}_1$](S$_0$)(uS$_0$)
\Edges[label = $\widetilde{p}_2$](S$_0$,mS$_0$)
\Edges[label = $\widetilde{p}_3$](S$_0$,dS$_0$)
%t=2
%u
\Edges[label = $\widetilde{p}_1$](uS$_0$,u$^2$S$_0$)
\Edges[label = $\widetilde{p}_2$](uS$_0$,umS$_0$)
\Edges[label = $\widetilde{p}_3$, color=red](uS$_0$,udS$_0$)
%m
\Edges[label = $\widetilde{p}_1$, color=blue](mS$_0$,umS$_0$)
\Edges[label = $\widetilde{p}_2$](mS$_0$,m$^2$S$_0$)
\Edges[label = $\widetilde{p}_3$,color=blue](mS$_0$,dmS$_0$)
%d
\Edges[label = $\widetilde{p}_1$,color=red](dS$_0$,udS$_0$)
\Edges[label = $\widetilde{p}_2$](dS$_0$,dmS$_0$)
\Edges[label = $\widetilde{p}_3$](dS$_0$,d$^2$S$_0$)
\end{tikzpicture}
\end{document}
我們所做的只是更多地展開最終節點,以便可以看到 p$_n$ 語句。否則它們會相互覆蓋而無法被看到。