我们如何在具有水平横向的单独页面中创建以下树形图?
答案1
粗略回答基于forest
:
\documentclass{standalone}
\usepackage{forest}
\begin{document}
\forestset{
L1/.style={fill=green,},
L2/.style={fill=orange,edge={orange,line width=2pt}},
L3/.style={fill=yellow,edge={yellow,line width=2pt}},
L4/.style={fill=pink,edge={pink,line width=2pt}},
}
\begin{forest}
for tree={
grow=0,reversed, % tree direction
parent anchor=east,child anchor=west, % edge anchors
edge={line cap=round},outer sep=+1pt, % edge/node connection
rounded corners,minimum width=15mm,minimum height=8mm, % node shape
l sep=10mm % level distance
}
[AAAA,L1
[EEEE,L2
[EEEE,L3
[YYYY,L4][AAAA,L4]
]
[DDDD,L3
[DDDD,L4][KKKK,L4]
]
[PPPP,L3
[KKKK,L4][KKKK,L4]
]
]
[OOOO,L2]
]
\end{forest}
\end{document}