\draw
다이어그램에서 또는 코드를 조정하지 않고 t=0을 노드 아래( \path
또는 위)로 이동하고 싶습니다 \node
. 내 코드 어딘가에 , 또는 다른 코드 와 label=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}