1

I have a graph, containing a few nodes, but because of the size of it dose it extend beond the page. How can i set it to automatic scale so it will fit the page? Also what can i do to center it on the page?

\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}

enter image description here

1 Answer 1

1

I don't know about automatic scaling, but you can use the scale= option for TiKZ, e.g.

\begin{tikzpicture}[scale=.75] .

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .