No diagrama, quero mover t=0 abaixo (ou acima) do nó sem ajustar para \draw
ou \path
código \node
. Posso anexar algum pequeno trecho de código, como label=above{...}
, anchor=south
ou algo mais em algum lugar do meu código? Parece que preciso ajustar \Vertex...
, mas não sei onde acrescentar algo para alterar o rótulo do nó.
Meu código atual é:
\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}
Passei mais de 3 horas construindo meu diagrama para ficar exatamente como eu queria, e este é meu problema final.
Responder1
\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}
Eu modifiquei o código aqui
\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}