我有一张包含几个节点的图表,但由于其大小,它超出了页面。我如何将其设置为自动缩放以适合页面?此外,我该怎么做才能使其位于页面中央?
\begin{tikzpicture}[>=stealth, every node/.style={circle, draw, minimum size=0.75cm}]
\graph [tree layout, grow=down, fresh nodes, level distance=0.5in, sibling distance=0.5in]
{[name=t1]
R -> {
b',
c,
d',
e
}
};
\begin{scope}[xshift=4.5cm]
\graph [tree layout, grow=down, fresh nodes, level distance=0.5in, sibling distance=0.5in]
{[name=tb]
R -> {
b,
c,
d,
e
}
};
\end{scope}
\begin{scope}[xshift=9cm]
\graph [tree layout, grow=down, fresh nodes, level distance=0.5in, sibling distance=0.5in]
{[name=t2]
R -> {
b,
c',
d,
e
}
};
\end{scope}
\begin{scope}[xshift=13.5cm]
\graph [tree layout, grow=down, fresh nodes, level distance=0.5in, sibling distance=0.5in]
{[name=tm]
R -> {
b',
c',
d',
e
}
};
\end{scope}
\node[draw=none,label={above left:$n_{1}$}] at (t1 R) {};
\node[draw=none,label={above left:$n_{b}$}] at (tb R) {};
\node[draw=none,label={above left:$n_{2}$}] at (t2 R) {};
\node[draw=none,label={above left:$n_{m}$}] at (tm R) {};
\end{tikzpicture}
答案1
我不知道自动缩放,但你可以使用scale=
TiKZ 的选项,例如
\begin{tikzpicture}[scale=.75]
。