Tikzpicture の問題: 特に "\Vertex" ファミリーの場合、ノードの下または上に配置するにはどうすればよいですか?

Tikzpicture の問題: 特に "\Vertex" ファミリーの場合、ノードの下または上に配置するにはどうすればよいですか?

問題はt=0、t=1、t=2に関係する。

図では、 、またはコードを調整せずに、 t=0 をノードの下 (または上) に移動したいと考えています。 \draw、 、または他のコードなどの小さな部分をコードのどこかに追加できますか? を調整する必要があるようですが、ノードのラベルを変更するためにどこに何かを追加すればよいかわかりません。\path\nodelabel=above{...}anchor=south\Vertex...

私の現在のコードは次のとおりです:

\documentclass[12pt]{article}
\usepackage{tikz}
\usepackage{verbatim}
\usepackage{tkz-berge}
\usetikzlibrary{trees, fit,shapes,arrows}
\usepackage{tkz-graph}
\begin{document}
  %banks path
.\begin{tikzpicture}[scale=3] 

...\GraphInit[vstyle=Classic]   

...\tikzset{EdgeStyle/.style={->,font=\scriptsize}}=[circle,draw]   

......\Vertex[x=0,y=1.5]{t=0}   

......\Vertex[x=1,y=1.5]{t=1}   

......\Vertex[x=2,y=1.5]{t=2}   

......\Edges\[label = $1+r$\]\(t=0,t=1\)

......\Edges\[label = $1+r$\]\(t=1,t=2\)

.\end{tikzpicture}   
\end{document}

希望通りの図を作成するために 3 時間以上を費やしましたが、これが最後の問題です。

答え1

 \documentclass[a4paper,landscape]{article}
 \usepackage[left=1cm]{geometry}
 \usepackage{amsmath}
 \usepackage{xcolor}
 \usepackage{tkz-berge}
 \usetikzlibrary{fit,shapes,arrows}
 \begin{document}
 %(tri) stock's path
 \centering
 \begin{tikzpicture}[scale=3]
    \GraphInit[vstyle=Classic]
    \SetUpVertex[Lpos=-90]
      \tikzset{VertexStyle/.style = {shape=circle, fill=black,
                           minimum size=13pt,inner sep=0pt}
         }
        \Vertex[x=0,y=1.5]{S$_0$}
        \Vertex[x=1,y=2]{uS$_0$}
        \Vertex[x=1,y=1]{d$S_0$}
        \Vertex[x=2,y=1.5]{ud$S_0$}
        \Vertex[x=2,y=2.5]{u$^2$S$_0$}
        \Vertex[x=2,y=.5]{d$^2S_0$}
        \tikzset{EdgeStyle/.style={->,font=\scriptsize},{below=15pt}}
            \Edge[label = $\widetilde{p}$](S$_0$)(uS$_0$) 
            \Edges[label = $1-\widetilde{p}$](S$_0$,d$S_0$)
            \Edges[label = $\widetilde{p}$](uS$_0$,u$^2$S$_0$)
            \Edges[label = $1-\widetilde{p}$](uS$_0$,ud$S_0$)
            \Edges[label = $1-\widetilde{p}$](d$S_0$,d$^2S_0$)
            \Edges[label = $\widetilde{p}$](d$S_0$,ud$S_0$)
 \end{tikzpicture}    
  \\
 %banks path
 \begin{tikzpicture}[scale=3]
    \GraphInit[vstyle=Classic]
    \SetUpVertex[Lpos=-90]
     \tikzset{VertexStyle/.style = {shape=circle, fill=black,
                           minimum size=13pt,inner sep=0pt}
         }
        \Vertex[x=0,y=1.5,]{t=0}
        \Vertex[x=1,y=1.5]{t=1}
        \Vertex[x=2,y=1.5]{t=2}
           \tikzset{EdgeStyle/.style={->,font=\scriptsize,above,sloped,midway}}
              \Edges[label = $1+r$](t=0,t=1)
              \Edges[label = $1+r$](t=1,t=2)

   \end{tikzpicture}
 \end{document}

ここに画像の説明を入力してください

ここでコードを変更しました

 \documentclass[a4paper,landscape]{article}
 \usepackage[left=1cm]{geometry}
 \usepackage{amsmath}
 \usepackage{xcolor}
 \usepackage{tkz-berge}
 \usetikzlibrary{fit,shapes,arrows}
 \begin{document}
 %(tri) stock's path
 \centering
 \begin{tikzpicture}[scale=3]
    \GraphInit[vstyle=Classic]
    \SetUpVertex[Lpos=-90]
      \tikzset{VertexStyle/.style = {shape=circle, fill=black,
                           minimum size=13pt,inner sep=0pt}
         }
        \Vertex[x=0,y=1.5]{S$_0$}
        \Vertex[x=1,y=2]{uS$_0$}
        \Vertex[x=1,y=1]{d$S_0$}
        \Vertex[x=2,y=1.5]{ud$S_0$}
        \Vertex[x=2,y=2.5]{u$^2$S$_0$}
        \Vertex[x=2,y=.5]{d$^2S_0$}

        %\tikzset{EdgeStyle/.style={->,font=\scriptsize,below=15pt}}
         \tikzset{EdgeStyle/.style={->,font=\scriptsize,above,sloped,midway}}
            \Edge[label = $\widetilde{p}$](S$_0$)(uS$_0$) 
            \Edges[label = $1-\widetilde{p}$](S$_0$,d$S_0$)
            \Edges[label = $\widetilde{p}$](uS$_0$,u$^2$S$_0$)
            \Edges[label = $1-\widetilde{p}$](uS$_0$,ud$S_0$)
            \Edges[label = $1-\widetilde{p}$](d$S_0$,d$^2S_0$)
            \Edges[label = $\widetilde{p}$](d$S_0$,ud$S_0$)
 \end{tikzpicture}    
  \\
 %banks path
 \begin{tikzpicture}[scale=3]
    \GraphInit[vstyle=Classic]
    \SetUpVertex[Lpos=-90]
     \tikzset{VertexStyle/.style = {shape=circle, fill=black,
                           minimum size=13pt,inner sep=0pt}
         }
        \Vertex[x=0,y=1.5,]{t=0}
        \Vertex[x=1,y=1.5]{t=1}
        \Vertex[x=2,y=1.5]{t=2}
           \tikzset{EdgeStyle/.style={->,font=\scriptsize,above,sloped,midway}}
              \Edges[label = $1+r$](t=0,t=1)
              \Edges[label = $1+r$](t=1,t=2)

   \end{tikzpicture}
 \end{document}

ここに画像の説明を入力してください

関連情報