我有以下代码,
\[\begin{tikzpicture}[level distance=50mm,sibling distance=22mm,every node/.style={rectangle,draw,inner sep=4pt}]
\node {}
child [draw=none,grow=left]{
child{node{$\frac{4}{3}(1.571583165)-\frac{1}{3}(1.859140914)=1.475730582$}edge from parent[draw=none]
child{node{$1.859140914$}}
child{node{$1.571583165$}}
}
child{node{$\frac{4}{3}(1.490678862)-\frac{1}{3}(1.571583165)=1.463710761$}edge from parent[draw=none]
child{node{$1.571583165$}}
child{node{$1.490678862$}}
}};
\end{tikzpicture}\]
其结果如下:
我想隐藏第一个节点,或者如果有一种方法可以启动一个有 2 个节点的树也不错,有什么想法吗?谢谢。
答案1
\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[level distance=50mm,sibling distance=22mm,every node/.style={rectangle,draw,inner sep=4pt}]
\node [draw=none] {}
child [draw=none,grow=left]{
child{node{$\frac{4}{3}(1.571583165)-\frac{1}{3}(1.859140914)=1.475730582$}edge from parent[draw=none]
child{node{$1.859140914$}}
child{node{$1.571583165$}}
}
child{node{$\frac{4}{3}(1.490678862)-\frac{1}{3}(1.571583165)=1.463710761$}edge from parent[draw=none]
child{node{$1.571583165$}}
child{node{$1.490678862$}}
}edge from parent[draw=none]};
\end{tikzpicture}
\end{document}