如何绘制这样的树形图

2020-12-10 11:48发布

## 编译环境 操作系统 * [x] Windows 7/8/10 Tex发行版 * [x] TexLive `2020` ## 关于LATEX作图的问题 如何绘制这样的树形图? ![](https:...

## 编译环境 操作系统 * [x] Windows 7/8/10 Tex发行版 * [x] TexLive `2020` ## 关于LATEX作图的问题 如何绘制这样的树形图? ![](https://wenda.latexstudio.net/data/attach/201210/yzN9CjVt.PNG)
2条回答
这个图,可能要用 `tikz` 的 `\usetikzlibrary{trees}` 吧。早年画过一个,后来就不想再用它画图了。 ``` \documentclass{ctexart} \usepackage{tikz} \usetikzlibrary{trees} \begin{document} \begin{tikzpicture} \node{$ A $对称}[ font=\small, edge from parent fork right, grow=right, edge from parent/.append style = {-latex}, level 1/.style = {level distance = 14ex, sibling distance=10em}, level 2/.style = {level distance = 19ex, sibling distance=5em}, level 3/.style = {level distance = 19ex, sibling distance=3em}, level 4/.style = {level distance = 26ex, sibling distance=6em} ] child{node{$ A^T $可用} child{node{存储花费大} child{ node{ \fbox{ \begin{minipage}{11ex} \textbf{GMRES},\\ FOM, GCR \end{minipage} } } edge from parent node[near end,above] {N} } child{node[text width = 12ex]{$ A $有复特征值} child{ node{ \fbox{ \begin{minipage}{13ex} \textbf{BiCGSTAB}\\ BiCRSTAB\\ CGS\\ GPBiCG\\ QMRCGSTAB\\ TFQMR \end{minipage} } } edge from parent node[near end,above] {N} } child{ node{ \fbox{ \begin{minipage}{13ex} BiCGSTAB($ l $)\\ IDR($ s $) \end{minipage} } } edge from parent node[near end,above] {Y} } edge from parent node[near end,above] {Y} } edge from parent node[near end,above] {N} } child{node{$ A $条件数好} child{node{BiCG, QMR} edge from parent node[near end,above] {N}} child{node{CGNR, CGNE} edge from parent node[near end,above] {Y} } edge from parent node[near end,above] {Y} } edge from parent node[near end,above] {N} } child{node{$ A $正定} child{node{$ A $条件数好} child{node{MINRES, MR} edge from parent node[near end,above] {N}} child{node{CGNR, CGNE} edge from parent node[near end,above] {Y}} edge from parent node[near end,above] {N} } child{node[text width=4\ccwd]{\textbf{CG}} edge from parent node[near end,above] {Y}} edge from parent node[near end,above] {Y} }; \end{tikzpicture} \end{document} ``` 都是以前玩的了

一周热门 更多>