答案1
这是一个forest
解决方案:
forest
有关其用于指定树的括号符号的介绍,请参阅我对先前问题的回答。
代码:
\documentclass[tikz,border=10pt]{standalone}
\usepackage{forest}
\begin{document}
\tikzset{
labelling/.style={inner sep=1.5pt, font=\footnotesize\sffamily, align=left}
}
\begin{forest}
make label/.style={
if n=1{
edge label={node[midway, below, anchor=north east, labelling] {#1}}
}{
edge label={node[midway, above, labelling, anchor=south east] {#1}}
}
},
for tree={
grow=east,
l sep+=15mm,
parent anchor=east,
child anchor=west,
delay={
if n children=0{
if content={}{}{
labelling,
anchor=west,
for parent={
tier=not quite terminus,
for tree={
calign=midpoint
},
},
}
}{
shape=coordinate
}
},
}
[, for tree={calign=fixed edge angles}, tikz={\draw [densely dashed] (!11) +(0,-7.5mm) node [below, labelling] {once per day} -- (!ll) -- +(0,7.5mm);}
[, make label={Some event\\or other occurs\\sometime\\$p=\alpha$}
[
[Some further thing]
[And another one]
]
[, phantom]
]
[, make label={Some other\\event or other\\occurs sometime\\$p=1-\alpha$}
[, make label={Something\\$p=\delta$}
[Something here]
[Something else]
]
[, make label={Something else\\$p=1-\delta$}
[Some other thing]
[Another thing else]
]
]
]
\end{forest}
\end{document}